Method and device for coding image on basis of inter prediction

ABSTRACT

A decoding method performed by a decoding device, according to the present document, may comprise the steps of: acquiring, from a bitstream, at least one of a combined inter-picture merge and intra-picture prediction (CIIP) enable flag and a coding unit (CU) skip flag indicating whether a skip mode is applied to a current block; acquiring, from the bitstream, a regular merge flag on the basis that a condition based on the current block size, and at least one of a condition based on the CIIP enable flag and a condition based on the CU skip flag are satisfied; generating prediction samples of the current block on the basis of the regular merge flag; and generating restoration samples on the basis of the prediction samples.

BACKGROUND OF THE DISCLOSURE Field of the Disclosure

The present disclosure relates to a method and apparatus for coding animage based on inter prediction.

Related Art

Recently, the demand for high resolution, high quality image/video suchas 4K, 8K or more Ultra High Definition (UHD) image/video is increasingin various fields. As the image/video resolution or quality becomeshigher, relatively more amount of information or bits are transmittedthan for conventional image/video data. Therefore, if image/video dataare transmitted via a medium such as an existing wired/wirelessbroadband line or stored in a legacy storage medium, costs fortransmission and storage are readily increased.

Moreover, interests and demand are growing for virtual reality (VR) andartificial reality (AR) contents, and immersive media such as hologram;and broadcasting of images/videos exhibiting image/video characteristicsdifferent from those of an actual image/video, such as gameimages/videos, are also growing.

Therefore, a highly efficient image/video compression technique isrequired to effectively compress and transmit, store, or play highresolution, high quality images/videos showing various characteristicsas described above.

SUMMARY

The present disclosure provides a method and apparatus for increasingimage coding efficiency.

The present disclosure also provides a method and apparatus forefficiently performing inter prediction.

The present disclosure also provides a method and apparatus forpreventing unnecessary signaling during inter prediction.

The present disclosure also provides a method and apparatus forefficiently signaling merge data syntax.

In an aspect, a decoding method performed by a decoding apparatusincludes: acquiring, from a bitstream, at least one of a combinedinter-picture merge and intra-picture prediction (CIIP) enabled flag anda coding unit (CU) skip flag indicating whether a skip mode is appliedto a current block; acquiring a regular merge flag from the bitstreambased on that at least one of a condition based on the CIIP enabled flagand a condition based on the CU skip flag and a condition based on asize of the current block are satisfied; performing inter predictionbased on the regular merge flag to generate prediction samples of thecurrent block; and generating reconstructed samples based on theprediction samples.

In another aspect, an encoding method performed by an encoding apparatusincludes: deriving prediction samples of a current block based on interprediction; generating information on a prediction mode indicating aprediction mode of the current block; deriving residual samples based onthe prediction samples; generating residual information based on theresidual samples; and encoding image information including theinformation on the prediction mode and the residual information, whereinthe image information includes at least one of a combined inter-picturemerge and intra-picture prediction (CIIP) enabled flag and a coding unit(CU) skip flag indicating whether a skip mode is applied to the currentblock, and the image information includes a regular merge flag based onthat at least one of a condition based on the CIIP enabled flag and acondition based on the CU skip flag and a condition based on a size ofthe current block are satisfied.

In another aspect, a digital storage medium, as a computer-readabledigital storage medium, includes information causing a decodingapparatus to perform a decoding method, wherein the decoding methodincludes: acquiring, from a bitstream, at least one of a combinedinter-picture merge and intra-picture prediction (CIIP) enabled flag anda coding unit (CU) skip flag indicating whether a skip mode is appliedto a current block; acquiring a regular merge flag from the bitstreambased on that at least one of a condition based on the CIIP enabled flagand a condition based on the CU skip flag and a condition based on asize of the current block are satisfied; performing inter predictionbased on the regular merge flag to generate prediction samples of thecurrent block; and generating a reconstructed picture based on theprediction samples.

Advantageous Effects

According to an embodiment of the present disclosure, overallimage/video compression efficiency may be improved.

According to an embodiment of the present disclosure, inter predictionmay be efficiently performed.

According to an embodiment of the present disclosure, signaling ofunnecessary syntax may be efficiently removed during inter prediction.

According to an embodiment of the present disclosure, merge data syntaxmay be efficiently signaled.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically shows an example of a video/image coding system towhich embodiments of the present disclosure may be applied.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which embodiments of the presentdisclosure may be applied.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which embodiments of the presentdisclosure may be applied.

FIG. 4 shows an example of an inter prediction-based video/imageencoding method.

FIG. 5 shows an example of a video/image decoding method based on interprediction.

FIG. 6 exemplarily shows an inter prediction procedure.

FIG. 7 is a diagram illustrating a spatial candidate that may be usedfor inter prediction.

FIG. 8 schematically shows a method for configuring a merge candidatelist.

FIG. 9 is a diagram illustrating a subblock-based temporal motion vectorprediction process that may be used in inter prediction.

FIGS. 10 and 11 schematically show an example of a video/image encodingmethod including an inter prediction method and related componentsaccording to an embodiment of the present document.

FIGS. 12 and 13 schematically show an example of a video/image decodingmethod including an inter prediction method and related componentsaccording to an embodiment of the present document.

FIG. 14 shows an example of a content streaming system to which theembodiments disclosed in this document may be applied.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The disclosure of the present disclosure may be modified in variousforms, and specific embodiments thereof will be described andillustrated in the drawings. The terms used in the present disclosureare used to merely describe specific embodiments, but are not intendedto limit the disclosed method in the present disclosure. An expressionof a singular number includes an expression of ‘at least one’, so longas it is clearly read differently. The terms such as “include” and“have” are intended to indicate that features, numbers, steps,operations, elements, components, or combinations thereof used in thedocument exist and it should be thus understood that the possibility ofexistence or addition of one or more different features, numbers, steps,operations, elements, components, or combinations thereof is notexcluded.

In addition, each configuration of the drawings described in thisdocument is an independent illustration for explaining functions asfeatures that are different from each other, and does not mean that eachconfiguration is implemented by mutually different hardware or differentsoftware. For example, two or more of the configurations may be combinedto form one configuration, and one configuration may also be dividedinto multiple configurations. Without departing from the gist of thedisclosed method of the present disclosure, embodiments in whichconfigurations are combined and/or separated are included in the scopeof the disclosure of the present disclosure.

In this document, the term “/” and “,” should be interpreted to indicate“and/or.” For instance, the expression “A/B” may mean “A and/or B.”Further, “A, B” may mean “A and/or B.” Further, “A/B/C” may mean “atleast one of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A,B, and/or C.

“Further, in the document, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in this document should be interpreted to indicate “additionally oralternatively.”

This document relates to video/image coding. For example, amethod/embodiment disclosed in this document may be applied to a methoddisclosed in a versatile video coding (VVC) standard. In addition, themethod/embodiment disclosed in this document may be applied to a methoddisclosed in an essential video coding (EVC) standard, AOMedia Video 1(AV1) standard, 2nd generation of audio video coding standard (AVS2), ora next-generation video/image coding standard (e.g., H.267, H.268,etc.).

Various embodiments related to video/image coding are presented in thisdocument, and the embodiments may be combined with each other unlessotherwise stated.

Hereinafter, embodiments of the present disclosure will be described indetail with reference to the accompanying drawings. In addition, likereference numerals are used to indicate like elements throughout thedrawings, and the same descriptions on the like elements may be omitted.

FIG. 1 illustrates an example of a video/image coding system to whichthe embodiments of the present disclosure may be applied.

Referring to FIG. 1, a video/image coding system may include a firstdevice (a source device) and a second device (a reception device). Thesource device may transmit encoded video/image information or data tothe reception device through a digital storage medium or network in theform of a file or streaming.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compaction and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

In this document, at least one of quantization/dequantization and/ortransform/inverse transform may be omitted. When thequantization/dequantization is omitted, the quantized transformcoefficient may be referred to as a transform coefficient. When thetransform/inverse transform is omitted, the transform coefficient may becalled a coefficient or a residual coefficient or may still be calledthe transform coefficient for uniformity of expression.

In this document, the quantized transform coefficient and the transformcoefficient may be referred to as a transform coefficient and a scaledtransform coefficient, respectively. In this case, the residualinformation may include information on transform coefficient(s), and theinformation on the transform coefficient(s) may be signaled throughresidual coding syntax. Transform coefficients may be derived based onthe residual information (or information on the transformcoefficient(s)), and scaled transform coefficients may be derivedthrough inverse transform (scaling) on the transform coefficients.Residual samples may be derived based on inverse transform (transform)of the scaled transform coefficients. This may be applied/expressed inother parts of this document as well.

In this document, a video may refer to a series of images over time. Apicture generally refers to the unit representing one image at aparticular time frame, and a slice/tile refers to the unit constitutinga part of the picture in terms of coding. A slice/tile may include oneor more coding tree units (CTUs). One picture may consist of one or moreslices/tiles. One picture may consist of one or more tile groups. Onetile group may include one or more tiles. A brick may represent arectangular region of CTU rows within a tile in a picture). A tile maybe partitioned into multiple bricks, each of which consisting of one ormore CTU rows within the tile. A tile that is not partitioned intomultiple bricks may be also referred to as a brick. A brick scan is aspecific sequential ordering of CTUs partitioning a picture in which theCTUs are ordered consecutively in CTU raster scan in a brick, brickswithin a tile are ordered consecutively in a raster scan of the bricksof the tile, and tiles in a picture are ordered consecutively in araster scan of the tiles of the picture. A tile is a rectangular regionof CTUs within a particular tile column and a particular tile row in apicture. The tile column is a rectangular region of CTUs having a heightequal to the height of the picture and a width specified by syntaxelements in the picture parameter set. The tile row is a rectangularregion of CTUs having a height specified by syntax elements in thepicture parameter set and a width equal to the width of the picture). Atile scan is a specific sequential ordering of CTUs partitioning apicture in which the CTUs are ordered consecutively in CTU raster scanin a tile whereas tiles in a picture are ordered consecutively in araster scan of the tiles of the picture. A slice includes an integernumber of bricks of a picture that may be exclusively contained in asingle NAL unit. A slice may consists of either a number of completetiles or only a consecutive sequence of complete bricks of one tile. Inthis document, tile group and slice can be used interchangeably. Forexample, in this document, a tile group/tile group header may bereferred to as a slice/slice header.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows. Alternatively, thesample may mean a pixel value in the spatial domain, and when such apixel value is transformed to the frequency domain, it may mean atransform coefficient in the frequency domain.

FIG. 2 is a diagram schematically illustrating the configuration of avideo/image encoding apparatus to which the embodiments of the presentdisclosure may be applied. Hereinafter, what is referred to as the videoencoding apparatus may include an image encoding apparatus.

Referring to FIG. 2, the encoding apparatus 200 may include and beconfigured with an image partitioner 210, a predictor 220, a residualprocessor 230, an entropy encoder 240, an adder 250, a filter 260, and amemory 270. The predictor 220 may include an inter predictor 221 and anintra predictor 222. The residual processor 230 may include atransformer 232, a quantizer 233, a dequantizer 234, and an inversetransformer 235. The residual processor 230 may further include asubtractor 231. The adder 250 may be called a reconstructor orreconstructed block generator. The image partitioner 210, the predictor220, the residual processor 230, the entropy encoder 240, the adder 250,and the filter 260, which have been described above, may be configuredby one or more hardware components (e.g., encoder chipsets orprocessors) according to an embodiment. In addition, the memory 270 mayinclude a decoded picture buffer (DPB), and may also be configured by adigital storage medium. The hardware component may further include thememory 270 as an internal/external component.

The image partitioner 210 may split an input image (or, picture, frame)input to the encoding apparatus 200 into one or more processing units.As an example, the processing unit may be called a coding unit (CU). Inthis case, the coding unit may be recursively split according to aQuad-tree binary-tree ternary-tree (QTBTTT) structure from a coding treeunit (CTU) or the largest coding unit (LCU). For example, one codingunit may be split into a plurality of coding units of a deeper depthbased on a quad-tree structure, a binary-tree structure, and/or aternary-tree structure. In this case, for example, the quad-treestructure is first applied and the binary-tree structure and/or theternary-tree structure may be later applied. Alternatively, thebinary-tree structure may also be first applied. A coding procedureaccording to the present disclosure may be performed based on a finalcoding unit which is not split any more. In this case, based on codingefficiency according to image characteristics or the like, the maximumcoding unit may be directly used as the final coding unit, or asnecessary, the coding unit may be recursively split into coding units ofa deeper depth, such that a coding unit having an optimal size may beused as the final coding unit. Here, the coding procedure may include aprocedure such as prediction, transform, and reconstruction to bedescribed later. As another example, the processing unit may furtherinclude a prediction unit (PU) or a transform unit (TU). In this case,each of the prediction unit and the transform unit may be split orpartitioned from the aforementioned final coding unit. The predictionunit may be a unit of sample prediction, and the transform unit may be aunit for inducing a transform coefficient and/or a unit for inducing aresidual signal from the transform coefficient.

The unit may be interchangeably used with the term such as a block or anarea in some cases. Generally, an M×N block may represent samplescomposed of M columns and N rows or a group of transform coefficients.The sample may generally represent a pixel or a value of the pixel, andmay also represent only the pixel/pixel value of a luma component, andalso represent only the pixel/pixel value of a chroma component. Thesample may be used as the term corresponding to a pixel or a pelconfiguring one picture (or image).

The encoding apparatus 200 may subtract the prediction signal (predictedblock, prediction sample array) output from the inter predictor 221 orthe intra predictor 222 from the input image signal (original block,original sample array) to generate a residual signal (residual block,residual sample array), and the generated residual signal is transmittedto the transformer 232. In this case, as illustrated, a unit forsubtracting the prediction signal (prediction block, prediction samplearray) from an input image signal (original block, original samplearray) in the encoder 200 may be referred to as a subtractor 231. Thepredictor 220 may perform prediction on a processing target block(hereinafter, referred to as a current block) and generate a predictedblock including prediction samples for the current block. The predictor220 may determine whether intra prediction or inter prediction isapplied in units of a current block or CU. The predictor 220 maygenerate various information on prediction, such as prediction modeinformation, and transmit the generated information to the entropyencoder 240, as is described below in the description of each predictionmode. The information on prediction may be encoded by the entropyencoder 240 and output in the form of a bitstream.

The intra predictor 222 may predict a current block with reference tosamples within a current picture. The referenced samples may be locatedneighboring to the current block, or may also be located away from thecurrent block according to the prediction mode. The prediction modes inthe intra prediction may include a plurality of non-directional modesand a plurality of directional modes. The non-directional mode mayinclude, for example, a DC mode or a planar mode. The directional modemay include, for example, 33 directional prediction modes or 65directional prediction modes according to the fine degree of theprediction direction. However, this is illustrative and the directionalprediction modes which are more or less than the above number may beused according to the setting. The intra predictor 222 may alsodetermine the prediction mode applied to the current block using theprediction mode applied to the neighboring block.

The inter predictor 221 may induce a predicted block of the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. At this time, in order to decreasethe amount of motion information transmitted in the inter predictionmode, the motion information may be predicted in units of a block, asub-block, or a sample based on the correlation of the motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter predictiondirection (L0 prediction, L1 prediction, Bi prediction, or the like)information. In the case of the inter prediction, the neighboring blockmay include a spatial neighboring block existing within the currentpicture and a temporal neighboring block existing in the referencepicture. The reference picture including the reference block and thereference picture including the temporal neighboring block may also bethe same as each other, and may also be different from each other. Thetemporal neighboring block may be called the name such as a collocatedreference block, a collocated CU (colCU), or the like, and the referencepicture including the temporal neighboring block may also be called acollocated picture (colPic). For example, the inter predictor 221 mayconfigure a motion information candidate list based on the neighboringblocks, and generate information indicating what candidate is used toderive the motion vector and/or the reference picture index of thecurrent block. The inter prediction may be performed based on variousprediction modes, and for example, in the case of a skip mode and amerge mode, the inter predictor 221 may use the motion information ofthe neighboring block as the motion information of the current block. Inthe case of the skip mode, the residual signal may not be transmittedunlike the merge mode. A motion vector prediction (MVP) mode mayindicate the motion vector of the current block by using the motionvector of the neighboring block as a motion vector predictor, andsignaling a motion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods to be described below. For example, the predictor 220may apply intra prediction or inter prediction for prediction of oneblock and may simultaneously apply intra prediction and interprediction. This may be called combined inter and intra prediction(CIIP). In addition, the predictor may be based on an intra block copy(IBC) prediction mode or based on a palette mode for prediction of ablock. The IBC prediction mode or the palette mode may be used forimage/video coding of content such as games, for example, screen contentcoding (SCC). IBC basically performs prediction within the currentpicture, but may be performed similarly to inter prediction in that areference block is derived within the current picture. That is, IBC mayuse at least one of the inter prediction techniques described in thisdocument. The palette mode may be viewed as an example of intra codingor intra prediction. When the palette mode is applied, a sample value inthe picture may be signaled based on information on the palette tableand the palette index.

The prediction signal generated by the predictor (including the interpredictor 221 and/or the intra predictor 222) may be used to generate areconstructed signal or may be used to generate a residual signal.

The transformer 232 may generate transform coefficients by applying atransform technique to the residual signal. For example, the transformtechnique may include at least one of a discrete cosine transform (DCT),a discrete sine transform (DST), a graph-based transform (GBT), or aconditionally non-linear transform (CNT). Here, GBT refers totransformation obtained from a graph when expressing relationshipinformation between pixels in the graph. CNT refers to transformationobtained based on a prediction signal generated using all previouslyreconstructed pixels. Also, the transformation process may be applied toa block of pixels having the same size as a square or may be applied toa block of a variable size that is not a square.

The quantizer 233 quantizes the transform coefficients and transmits thesame to the entropy encoder 240, and the entropy encoder 240 encodes thequantized signal (information on the quantized transform coefficients)and outputs the encoded signal as a bitstream. Information on thequantized transform coefficients may be referred to as residualinformation. The quantizer 233 may rearrange the quantized transformcoefficients in the block form into a one-dimensional vector form basedon a coefficient scan order and may generate information on thetransform coefficients based on the quantized transform coefficients inthe one-dimensional vector form.

The entropy encoder 240 may perform various encoding methods such as,for example, exponential Golomb, context-adaptive variable length coding(CAVLC), and context-adaptive binary arithmetic coding (CABAC). Theentropy encoder 240 may encode information necessary for video/imagereconstruction (e.g., values of syntax elements, etc.) other than thequantized transform coefficients together or separately. Encodedinformation (e.g., encoded video/image information) may be transmittedor stored in units of a network abstraction layer (NAL) unit in the formof a bitstream. The video/image information may further includeinformation on various parameter sets, such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). Also, the video/image informationmay further include general constraint information. In this document,information and/or syntax elements transmitted/signaled from theencoding apparatus to the decoding apparatus may be included invideo/image information. The video/image information may be encodedthrough the encoding procedure described above and included in thebitstream. The bitstream may be transmitted through a network or may bestored in a digital storage medium. Here, the network may include abroadcasting network and/or a communication network, and the digitalstorage medium may include various storage media such as USB, SD, CD,DVD, Blu-ray, HDD, and SSD. A transmitting unit (not shown) and/or astoring unit (not shown) for transmitting or storing a signal outputfrom the entropy encoder 240 may be configured as internal/externalelements of the encoding apparatus 200, or the transmitting unit may beincluded in the entropy encoder 240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transform unit235. The adder 250 may add the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). When there is noresidual for the processing target block, such as when the skip mode isapplied, the predicted block may be used as a reconstructed block. Theadder 250 may be referred to as a restoration unit or a restorationblock generator. The generated reconstructed signal may be used forintra prediction of a next processing target block in the currentpicture, or may be used for inter prediction of the next picture afterbeing filtered as described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringa picture encoding and/or reconstruction process.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture, and store the modifiedreconstructed picture in the memory 270, specifically, in a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variouskinds of information related to the filtering, and transfer thegenerated information to the entropy encoder 240 as described later inthe description of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as a reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatusmay be avoided and encoding efficiency may be improved.

The DPB of the memory 270 may store the modified reconstructed picturefor use as the reference picture in the inter predictor 221. The memory270 may store motion information of a block from which the motioninformation in the current picture is derived (or encoded) and/or motioninformation of blocks in the picture, having already been reconstructed.The stored motion information may be transferred to the inter predictor221 to be utilized as motion information of the spatial neighboringblock or motion information of the temporal neighboring block. Thememory 270 may store reconstructed samples of reconstructed blocks inthe current picture, and may transfer the reconstructed samples to theintra predictor 222.

FIG. 3 is a diagram for schematically explaining the configuration of avideo/image decoding apparatus to which the embodiments of the presentdisclosure may be applied.

Referring to FIG. 3, the decoding apparatus 300 may include andconfigured with an entropy decoder 310, a residual processor 320, apredictor 330, an adder 340, a filter 350, and a memory 360. Thepredictor 330 may include an inter predictor 331 and an intra predictor332. The residual processor 320 may include a dequantizer 321 and aninverse transformer 322. The entropy decoder 310, the residual processor320, the predictor 330, the adder 340, and the filter 350, which havebeen described above, may be configured by one or more hardwarecomponents (e.g., decoder chipsets or processors) according to anembodiment. Further, the memory 360 may include a decoded picture buffer(DPB), and may be configured by a digital storage medium. The hardwarecomponent may further include the memory 360 as an internal/externalcomponent.

When the bitstream including the video/image information is input, thedecoding apparatus 300 may reconstruct the image in response to aprocess in which the video/image information is processed in theencoding apparatus illustrated in FIG. 2. For example, the decodingapparatus 300 may derive the units/blocks based on block split-relatedinformation acquired from the bitstream. The decoding apparatus 300 mayperform decoding using the processing unit applied to the encodingapparatus. Therefore, the processing unit for the decoding may be, forexample, a coding unit, and the coding unit may be split according tothe quad-tree structure, the binary-tree structure, and/or theternary-tree structure from the coding tree unit or the maximum codingunit. One or more transform units may be derived from the coding unit.In addition, the reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (e.g.,video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthis document may be decoded may decode the decoding procedure andobtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, context-adaptive variable length coding(CAVLC), or context-adaptive arithmetic coding (CABAC), and outputsyntax elements required for image reconstruction and quantized valuesof transform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model by using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (interpredictor 332 and intra predictor 331), and residual values on which theentropy decoding has been performed in the entropy decoder 310, that is,the quantized transform coefficients and related parameter information,may be input to the residual processor 320.

The residual processor 320 may derive a residual signal (residual block,residual samples, residual sample array). Also, information on filteringamong the information decoded by the entropy decoder 310 may be providedto the filter 350. Meanwhile, a receiving unit (not shown) for receivinga signal output from the encoding apparatus may be further configured asan internal/external element of the decoding apparatus 300, or thereceiving unit may be a component of the entropy decoder 310. Meanwhile,the decoding apparatus according to this document may be called avideo/image/picture decoding apparatus, and the decoding apparatus maybe divided into an information decoder (video/image/picture informationdecoder) and a sample decoder (video/image/picture sample decoder). Theinformation decoder may include the entropy decoder 310, and the sampledecoder may include at least one of the dequantizer 321, the inversetransformer 322, the adder 340, the filter 350, the memory 360, an interpredictor 332, and an intra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsto output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in a two-dimensional block form. Inthis case, the rearrangement may be performed based on a coefficientscan order performed by the encoding apparatus. The dequantizer 321 mayperform dequantization for the quantized transform coefficients using aquantization parameter (e.g., quantization step size information), andacquire the transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to acquire the residual signal (residual block, residualsample array).

The predictor 330 may perform the prediction of the current block, andgenerate a predicted block including the prediction samples of thecurrent block. The predictor may determine whether the intra predictionis applied or the inter prediction is applied to the current block basedon the information on prediction output from the entropy decoder 310,and determine a specific intra/inter prediction mode.

The predictor 330 may generate a prediction signal based on variousprediction methods to be described later. For example, the predictor mayapply intra prediction or inter prediction for prediction of one block,and may simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). In addition,the predictor may be based on an intra block copy (IBC) prediction modeor based on a palette mode for prediction of a block. The IBC predictionmode or the palette mode may be used for image/video coding of contentsuch as games, for example, screen content coding (SCC). IBC maybasically perform prediction within the current picture, but may beperformed similarly to inter prediction in that a reference block isderived within the current picture. That is, IBC may use at least one ofthe inter prediction techniques described in this document. The palettemode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, information on the palettetable and the palette index may be included in the video/imageinformation and signaled.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block, or may be located apart fromthe current block according to the prediction mode. In intra prediction,prediction modes may include a plurality of non-directional modes and aplurality of directional modes. The intra predictor 331 may determinethe prediction mode to be applied to the current block by using theprediction mode applied to the neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information being transmitted in the interprediction mode, motion information may be predicted in the unit ofblocks, subblocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include information on interprediction direction (L0 prediction, L1 prediction, Bi prediction, andthe like). In case of inter prediction, the neighboring block mayinclude a spatial neighboring block existing in the current picture anda temporal neighboring block existing in the reference picture. Forexample, the inter predictor 332 may construct a motion informationcandidate list based on neighboring blocks, and derive a motion vectorof the current block and/or a reference picture index based on thereceived candidate selection information. Inter prediction may beperformed based on various prediction modes, and the information on theprediction may include information indicating a mode of inter predictionfor the current block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, or reconstructed sample array) by addingthe obtained residual signal to the prediction signal (predicted blockor predicted sample array) output from the predictor (including interpredictor 332 and/or intra predictor 331). If there is no residual forthe processing target block, such as a case that a skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called a reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for the intraprediction of a next block to be processed in the current picture, andas described later, may also be output through filtering or may also beused for the inter prediction of a next picture.

Meanwhile, a luma mapping with chroma scaling (LMCS) may also be appliedin the picture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture, and store the modifiedreconstructed picture in the memory 360, specifically, in a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture having already beenreconstructed. The stored motion information may be transferred to theinter predictor 332 so as to be utilized as the motion information ofthe spatial neighboring block or the motion information of the temporalneighboring block. The memory 360 may store reconstructed samples ofreconstructed blocks in the current picture, and transfer thereconstructed samples to the intra predictor 331.

In this disclosure, the embodiments described in the filter 260, theinter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be applied equally or to correspond to the filter 350,the inter predictor 332, and the intra predictor 331.

Meanwhile, as described above, in performing video coding, prediction isperformed to improve compression efficiency. Through this, a predictedblock including prediction samples for a current block as a block to becoded (i.e., a coding target block) may be generated. Here, thepredicted block includes prediction samples in a spatial domain (orpixel domain). The predicted block is derived in the same manner in anencoding apparatus and a decoding apparatus, and the encoding apparatusmay signal information (residual information) on residual between theoriginal block and the predicted block, rather than an original samplevalue of an original block, to the decoding apparatus, therebyincreasing image coding efficiency. The decoding apparatus may derive aresidual block including residual samples based on the residualinformation, add the residual block and the predicted block to generatereconstructed blocks including reconstructed samples, and generate areconstructed picture including the reconstructed blocks.

The residual information may be generated through a transform andquantization procedure. For example, the encoding apparatus may derive aresidual block between the original block and the predicted block,perform a transform procedure on residual samples (residual samplearray) included in the residual block to derive transform coefficients,perform a quantization procedure on the transform coefficients to derivequantized transform coefficients, and signal related residualinformation to the decoding apparatus (through a bitstream). Here, theresidual information may include value information of the quantizedtransform coefficients, location information, a transform technique, atransform kernel, a quantization parameter, and the like. The decodingapparatus may perform dequantization/inverse transform procedure basedon the residual information and derive residual samples (or residualblocks). The decoding apparatus may generate a reconstructed picturebased on the predicted block and the residual block. Also, for referencefor inter prediction of a picture afterward, the encoding apparatus mayalso dequantize/inverse-transform the quantized transform coefficientsto derive a residual block and generate a reconstructed picture basedthereon.

When inter prediction is applied to a current block, the predictor ofthe encoding apparatus/decoding apparatus may perform the interprediction in units of blocks and derive the prediction sample. Interprediction may be a prediction derived in a manner that is dependent ondata elements (e.g., sample values or motion information) of picture(s)other than the current picture. When inter prediction is applied to thecurrent block, a predicted block (prediction sample array) for thecurrent block may be derived based on a reference block (referencesample array) specified by a motion vector on a reference picture whicha reference picture index indicates. At this time, in order to reducethe amount of motion information transmitted in the inter predictionmode, the motion information of the current block may be predicted inunits of blocks, subblocks, or samples, based on correlation of motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter prediction type(L0 prediction, L1 prediction, Bi prediction, etc.) information. Wheninter prediction is applied, the neighboring block may include a spatialneighboring block existing in the current picture and a temporalneighboring block existing in the reference picture. The referencepicture including the reference block, and the reference pictureincluding the temporal neighboring block may be the same to each otheror different from each other. The temporal neighboring block may becalled a collocated reference block, a collocated CU (colCU), and thelike, and the reference picture including the temporal neighboring blockmay be called a collocated picture (colPic). For example, motioninformation candidate list may be configured based on neighboring blocksof the current block, and a flag or index information indicating whichcandidate is selected (used) in order to derive a motion vector and/or areference picture index of the current block may be signaled. Interprediction may be performed based on various prediction modes. Forexample, in the case of a skip mode and a (normal) merge mode, motioninformation of the current block may be the same as motion informationof the selected neighboring block. In the skip mode, unlike the mergemode, the residual signal may not be transmitted. In the case of motioninformation prediction (motion vector prediction (MVP)) mode, a motionvector of the selected neighboring block may be used as a motion vectorpredictor, and a motion vector difference may be signaled. In this case,a motion vector of the current block may be derived using the sum of themotion vector predictor and motion vector difference.

A video/image encoding procedure based on inter prediction mayschematically include, for example, the following.

FIG. 4 shows an example of an inter prediction-based video/imageencoding method.

The encoding apparatus performs inter prediction on the current block(S400). The encoding apparatus may derive an inter prediction mode andmotion information of the current block, and generate prediction samplesof the current block. Here, the procedures of determining the interprediction mode, deriving motion information, and generating predictionsamples may be performed simultaneously, or one procedure may beperformed before another procedure. For example, the inter predictor ofthe encoding apparatus may include a prediction mode determiner, amotion information deriver, and a prediction sample deriver, theprediction mode determiner may determine the prediction mode for thecurrent block, and the motion information deriver may derive motioninformation of the current block, and the prediction sample deriver mayderive prediction samples of the current block. For example, the interpredictor of the encoding apparatus searches for a block similar to thecurrent block within a predetermined region (search region) of referencepictures through motion estimation and derive a reference block in whicha difference from the current block is a minimum or a predeterminedreference or less. Based on this, a reference picture index indicating areference picture in which the reference block is located may bederived, and a motion vector may be derived based on a positiondifference between the reference block and the current block. Theencoding apparatus may determine a mode applied to the current blockfrom among various prediction modes. The encoding apparatus may comparerate-distortion (RD) costs for the various prediction modes anddetermine an optimal prediction mode for the current block.

For example, when a skip mode or a merge mode is applied to the currentblock, the encoding apparatus may construct a merge candidate list to bedescribed later and derive a reference block in which a difference fromthe current block is minimal or a predetermined reference or less, amongreference blocks indicated by merge candidates included in the mergecandidate list. In this case, a merge candidate associated with thederived reference block may be selected, and merge index informationindicating the selected merge candidate may be generated and signaled tothe decoding apparatus. The motion information of the current block maybe derived using the motion information of the selected merge candidate.

As another example, when the (A)MVP mode is applied to the currentblock, the encoding apparatus constructs an (A)MVP candidate list to bedescribed later, and use a motion vector of a selected mvp candidate,among motion vector predictor (mvp) candidates included in the (A)MVPcandidate list, as an mvp of the current block. In this case, forexample, a motion vector indicating a reference block derived by themotion estimation described above may be used as the motion vector ofthe current block, and an mvp candidate having a motion vector havingthe smallest difference from the motion vector of the current block,among the mvp candidates, may be the selected mvp candidate. A motionvector difference (MVD) that is a difference obtained by subtracting themvp from the motion vector of the current block may be derived. In thiscase, information on the MVD may be signaled to the decoding apparatus.In addition, when the (A)MVP mode is applied, the value of the referencepicture index may be configured as reference picture index informationand separately signaled to the decoding apparatus.

The encoding apparatus may derive residual samples based on theprediction samples (S410). The encoding apparatus may derive theresidual samples by comparing the original samples of the current blockwith the prediction samples.

The encoding apparatus encodes image information including predictioninformation and residual information (S420). The encoding apparatus mayoutput encoded image information in the form of a bitstream. Theprediction information may include information on prediction modeinformation (e.g., skip flag, merge flag or mode index, etc.) and motioninformation as information related to the prediction procedure. Theinformation on the motion information may include candidate selectioninformation (e.g., merge index, mvp flag, or mvp index) that isinformation for deriving a motion vector. In addition, the informationon the motion information may include the MVD information describedabove and/or reference picture index information. Also, the informationon the motion information may include information indicating whether L0prediction, L1 prediction, or pair (bi) prediction is applied. Theresidual information is information on the residual samples. Theresidual information may include information on quantized transformcoefficients for the residual samples.

The output bitstream may be stored in a (digital) storage medium andtransmitted to the decoding apparatus or may be transmitted to thedecoding apparatus through a network.

Meanwhile, as described above, the encoding apparatus may generate areconstructed picture (including reconstructed samples and reconstructedblocks) based on the reference samples and the residual samples. This isbecause the encoding apparatus may derive the same prediction result asthat performed by the decoding apparatus, and through this, codingefficiency may be increased. Accordingly, the encoding apparatus maystore the reconstructed picture (or reconstructed samples, reconstructedblock) in a memory and use the reconstructed picture as a referencepicture for inter prediction. As described above, an in-loop filteringprocedure may be further applied to the reconstructed picture.

A video/image decoding procedure based on inter prediction mayschematically include, for example, the following.

FIG. 5 shows an example of a video/image decoding method based on interprediction.

Referring to FIG. 5, the decoding apparatus may perform an operationcorresponding to the operation performed by the encoding apparatus. Thedecoding apparatus may perform prediction on the current block based onthe received prediction information and derive prediction samples.

Specifically, the decoding apparatus may determine a prediction mode forthe current block based on the received prediction information (S500).The decoding apparatus may determine which inter prediction mode is tobe applied to the current block based on prediction mode information inthe prediction information.

For example, based on the merge flag, it may be determined whether themerge mode is applied to the current block or whether the (A)MVP mode isdetermined. Alternatively, one of various inter prediction modecandidates may be selected based on the mode index. The inter predictionmode candidates may include skip mode, merge mode, and/or (A)MVP mode,or may include various inter prediction modes to be described later.

The decoding apparatus derives motion information of the current blockbased on the determined inter prediction mode (S510). For example, whenthe skip mode or the merge mode is applied to the current block, thedecoding apparatus may construct a merge candidate list to be describedlater and select one merge candidate from among the merge candidatesincluded in the merge candidate list. The selection may be performedbased on the selection information (merge index) described above. Themotion information of the current block may be derived using the motioninformation of the selected merge candidate. The motion information ofthe selected merge candidate may be used as the motion information ofthe current block.

As another example, when the (A)MVP mode is applied to the currentblock, the decoding apparatus may construct an (A)MVP candidate list tobe described later and use a motion vector of a selected mvp candidate,among motion vector predictor (mvp) candidates included in the (A)MVPcandidate list, as the mvp of the current block. The selection may beperformed based on the selection information (mvp flag or mvp index)described above. In this case, the MVD of the current block may bederived based on the information on the MVD, and a motion vector of thecurrent block may be derived based on the mvp of the current block andthe MVD. Also, the reference picture index of the current block may bederived based on the reference picture index information. A pictureindicated by the reference picture index in the reference picture listfor the current block may be derived as a reference picture referencedfor inter prediction of the current block.

Meanwhile, as will be described later, the motion information of thecurrent block may be derived without configuring a candidate list. Inthis case, the motion information of the current block may be derivedaccording to a procedure disclosed in a prediction mode to be describedlater. In this case, the configuration of the candidate list asdescribed above may be omitted.

The decoding apparatus may generate prediction samples for the currentblock based on the motion information of the current block (S520). Inthis case, the reference picture may be derived based on the referencepicture index of the current block, and prediction samples of thecurrent block may be derived using samples of the reference blockindicated by the motion vector of the current block on the referencepicture. In this case, as described later, a prediction sample filteringprocedure may be further performed on all or some of the predictionsamples of the current block in some cases.

For example, the inter predictor of the decoding apparatus may include aprediction mode determiner, a motion information deriver, and aprediction sample deriver. The prediction mode determiner may determinea prediction mode for the current block based on the received predictionmode information, the motion information deriver may derive motioninformation (motion vector and/or reference picture index, etc.) of thecurrent block based on the information on the received motioninformation received, and the prediction sample deriver may deriveprediction samples of the current block.

The decoding apparatus generates residual samples for the current blockbased on the received residual information (S530). The decodingapparatus may generate reconstructed samples for the current block basedon the prediction samples and the residual samples, and generate areconstructed picture based thereon (S540). Thereafter, as describedabove, an in-loop filtering procedure may be further applied to thereconstructed picture.

FIG. 6 exemplarily shows an inter prediction procedure.

Referring to FIG. 6, as described above, the inter prediction proceduremay include determining an inter prediction mode, deriving motioninformation according to the determined prediction mode, and performingprediction based on the derived motion information (generation of aprediction sample). The inter prediction procedure may be performed bythe encoding apparatus and the decoding apparatus as described above. Inthis document, a coding apparatus may include the encoding apparatusand/or the decoding apparatus.

Referring to FIG. 6, the coding apparatus determines an inter predictionmode for the current block (S600). Various inter prediction modes may beused for prediction of a current block within a picture. For example,various modes such as merge mode, skip mode, motion vector prediction(MVP) mode, affine mode, subblock merge mode, merge with MVD (MMVD)mode, historical motion vector prediction (HMVP) mode, etc. DMVR(decoder side motion vector refinement) mode, AMVR (adaptive motionvector resolution) mode, BCW (Bi-prediction with CU-level weight), BDOF(Bi-directional optical flow), etc. May be used as ancillary modes inaddition or instead. The affine mode may be referred to as an affinemotion prediction mode. The MVP mode may be referred to as an advancedmotion vector prediction (AMVP) mode. In this document, some modesand/or motion information candidates derived by some modes may beincluded as one of motion information-related candidates of other modes.For example, the HMVP candidate may be added as a merge candidate of themerge/skip mode or may be added as an mvp candidate of the MVP mode.

The prediction mode information indicating the inter prediction mode ofthe current block may be signaled from the encoding apparatus to thedecoding apparatus. The prediction mode information may be included in abitstream and received at the decoding apparatus. The prediction modeinformation may include index information indicating one of multiplecandidate modes. Further, the inter prediction mode may be indicatedthrough hierarchical signaling of flag information. In this case, theprediction mode information may include one or more flags. For example,it may be indicated whether the skip mode is applied by signaling theskip flag; it may be indicated whether the merge mode is applied bysignaling the merge flag for the skip mode not being applied; and it maybe indicated that the MVP mode is applied or a flag for furtherpartition may be further signaled when the merge mode is not applied.The affine mode may be signaled as an independent mode, or may besignaled as a mode dependent on the merge mode, the MVP mode or thelike. For example, the affine mode may include an affine merge mode andan affine MVP mode.

Meanwhile, information indicating whether or not the above-describedlist0 (L0) prediction, list1 (L1) prediction, or bi-prediction is usedin the current block (current coding unit) may be signaled to thecurrent block. Said information may be referred to as motion predictiondirection information, inter prediction direction information, or interprediction indication information, and may beconstructed/encoded/signaled in the form of, for example, aninter_pred_idc syntax element. That is, the inter_pred_idc syntaxelement may indicate whether or not the above-described list0 (L0)prediction, list1(L1) prediction, or bi-prediction is used for thecurrent block (current coding unit). In this document, for convenienceof description, the inter prediction type (L0 prediction, L1 prediction,or BI prediction) indicated by the inter_pred_idc syntax element may berepresented as a motion prediction direction. L0 prediction may berepresented by pred_L0; L1 prediction may be represented by pred_L1; andbi-prediction may be represented by pred_BI. For example, the followingprediction type may be indicated according to the value of theinter_pred_idc syntax element.

As described above, one picture may include one or more slices. A slicemay have one of the slice types including intra (I) slice, predictive(P) slice, and bi-predictive (B) slice. The slice type may be indicatedbased on slice type information. For blocks in I slice, inter predictionis not used for prediction, and only intra prediction may be used. Ofcourse, even in this case, the original sample value may be coded andsignaled without prediction. For blocks in P slice, intra prediction orinter prediction may be used, and when inter prediction is used, onlyuni prediction may be used. Meanwhile, intra prediction or interprediction may be used for blocks in B slice, and when inter predictionis used, up to the maximum bi-prediction may be used.

L0 and L1 may include reference pictures encoded/decoded before thecurrent picture. For example, L0 may include reference pictures beforeand/or after the current picture in POC order, and L1 may includereference pictures after and/or before the current picture in POC order.In this case, a reference picture index lower relative to referencepictures earlier than the current picture in POC order may be allocatedto L0, and a reference picture index lower relative to referencepictures later than the current picture in POC order may be allocated toL1. In the case of B slice, bi-prediction may be applied, and in thiscase, unidirectional bi-prediction may be applied, or bi-directionalbi-prediction may be applied. Bi-directional bi-prediction may bereferred to as true bi-prediction.

Specifically, for example, information on the inter prediction mode ofthe current block may be coded and signaled at a CU (CU syntax) level orthe like, or may be implicitly determined according to a condition. Inthis case, some modes may be explicitly signaled, and other modes may beimplicitly derived.

For example, the CU syntax may carry information on the (inter)prediction mode, etc. As shown in Table 1 below.

TABLE 1 Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {if( slice_type != I | | sps_ibc_enabled_flag ) { if( treeType !=DUAL_TREE_CHROMA && !( cbWidth = = 4 && cbHeight = = 4 &&!sps_ibc_enabled_flag ) ) cu_skip_flag[ x0 ][ y0 ] ae(v) if(cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I && !( cbWidth = = 4 &&cbHeight = = 4 ) ) pred_mode_flag ae(v) if( ( ( slice_type = = I &&cu_skip_flag[ x0 ][ y0 ] = =0 ) | | ( slice_type != I && ( CuPredMode[x0 ][ y0 ] != MODE_INTRA | | ( cbWidth = = 4 && cbHeight = = 4 &&cu_skip_flag[ x0 ][ y0 ] = = 0 ) ) ) ) && sps_ibc_enabled_flag && (cbWidth != 128 | | cbHeight != 128 ) ) pred_mode_ibc_flag ae(v) } if(CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) { if( sps_pcm_enabled_flag &&cbWidth >= MinIpcmCbSizeY && cbWidth <= MaxIpcmCbSizeY && cbHeight >=MinIpcmCbSizeY && cbHeight <= MaxIpcmCbSizeY ) pcm_flag[ x0 ][ y0 ]ae(v) if( pcm_flag[ x0 ][ y0 ] ) { while( !byte_aligned( ) )pcm_alignment_zero_bit f(1) pcm_sample( cbWidth, cbHeight, treeType) }else { if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {if( cbWidth <= 32 && cbHeight <= 32 ) intra_bdpcm_flag[ x0 ][ y0 ] ae(v)if( intra_bdpcm_flag[ x0 ][ y0 ] ) intra_bdpcm_dir_flag[ x0 ][ y0 ]ae(v) else { if( sps_mip_enabled_flag && ( Abs( Log2( cbWidth ) − Log2(cbHeight ) ) <= 2 ) && cbWidth <= MaxTbSizeY && cbHeight <= MaxTbSizeY )intra_mip_flag[ x0 ][ y0 ] ae(v) if( intra_mip_flag[ x0 ][ y0 ] ) {intra_mip_mpm_flag[ x0 ] [ y0 ] ae(v) if( intra_mip_mpm_flag[ x0 ][ y0 ]) intra_mip_mpm_idx[ x0 ][ y0 ] ae(v) else intra_mip_mpm_remainder[ x0][ y0 ] ae(v) } else { if( sps_mrl_enabled_flag && ( ( y0 % CtbSizeY ) >0 ) ) intra_luma_ref_idx[ x0 ][ y0 ] ae(v) if ( sps_isp_enabled_flag &&intra_luma_ref_idx[ x0 ][ y0 ] = = 0 && ( cbWidth <= MaxTbSizeY &&cbHeight <= MaxTbSizeY ) && ( cbWidth * cbHeight > MinTbSizeY *MinTbSizeY ) ) intra_subpartitions_mode_flag[ x0 ][ y0 ] ae(v) if(intra_subpartitions_mode_flag[ x0 ][ y0 ] = = 1 && cbWidth <= MaxTbSizeY&& cbHeight <= MaxTbSizeY ) intra_subpartitions_split_flag[ x0 ][ y0 ]ae(v) if( intra_luma_ref_idx[ x0 ][ y0 ] = = 0 &&intra_subpartitions_mode_flag[ x0 ][ y0 ] = = 0 ) intra_luma_mpm_flag[x0 ][ y0 ] ae(v) if( intra_luma_mpm_flag[ x0 ][ y0 ] ) { if(intra_luma_ref_idx[ x0 ][ y0 ] = = 0 ) intra_luma_not_planar_flag[ x0 ][y0 ] ae(v) if( intra_luma_not_planar_flag[ x0 ][ y0 ] )intra_luma_mpm_idx[ x0 ][ y0 ] ae(v) } else intra_luma_mpm_remainder[ x0][ y0 ] ae(v) } } } if( treeType = = SINGLE_TREE | | treeType = =DUAL_TREE_CHROMA ) intra_chroma_pred_mode[ x0 ][ y0 ] ae(v) } } else if(treeType != DUAL_TREE_CHROMA ) { /* MODE_INTER or MODE_IBC */ if(cu_skip_flag[ x0 ][ y0 ] = = 0 ) general_merge_flag[ x0 ][ y0 ] ae(v)if( general_merge_flag[ x0 ][ y0 ] ) { merge_data( x0, y0, cbWidth,cbHeight ) } else if ( CuPredMode[ x0 ][ y0 ] = = MODE_IBC ) {mvd_coding( x0, y0, 0, 0 ) mvp_l0_flag[ x0 ][ y0 ] ae(v) if(sps_amvr_enabled_flag && ( MvdL0[ x0 ][ y0 ][ 0 ] != 0 | | ( MvdL0[ x0][ y0 ][ 1 ] != 0 ) ) { amvr_precision_flag[ x0 ][ y0 ] ae(v) } } else {if( slice_type = = B ) inter_pred_idc[ x0 ][ y0 ] ae(v) if(sps_affine_enabled_flag && cbWidth >= 16 && cbHeight >= 16 ) {inter_affine_flag[ x0 ][ y0 ] ae(v) if( sps_affine_type_flag &&inter_affine_flag[ x0 ][ y0 ] ) cu_affine_type_flag[ x0 ][ y0 ] ae(v) }if( sps_smvd_enabled_flag && inter_pred_idc[ x0 ][ y0 ] = = PRED_BI &&!inter_affine_flag[ x0 ][ y0 ] && RefIdxSymL0 > −1 && RefIdxSymL1 > −1 )sym_mvd_flag[ x0 ][ y0 ] ae(v) if( inter_pred_idc[ x0 ][ y0 ] != PRED_L1) { if( NumRefIdxActive[ 0 ] > 1 && !sym_mvd_flag[ x0 ][ y0 ] )ref_idx_l0[ x0 ][ y0 ] ae(v) mvd_coding( x0, y0, 0, 0 ) if(MotionModelIdc[ x0 ][ y0 ] > 0 ) mvd_coding( x0, y0, 0, 1 )if(MotionModelIdc[ x0 ][ y0 ] > I ) mvd_coding( x0, y0, 0, 2 )mvp_l0_flag[ x0 ][ y0 ] ae(v) } else { MvdL0[ x0 ][ y0 ][ 0 ] = 0 MvdL0[x0 ][ y0 ][ 1 ] = 0 } if( inter_pred_idc[ x0 ][ y0 ] != PRED_L0 ) { if(NumRefIdxActive[ 1 ] > 1 && !sym_mvd_flag[ x0 ][ y0 ] ) ref_idx_l1[ x0][ y0 ] ae(v) if( mvd_l1_zero_flag && inter_pred_idc[ x0 ][ y0 ] = =PRED_BI ) { MvdL1[ x0 ][ y0 ][ 0 ] = 0 MvdL1[ x0 ][ y0 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 0 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 0 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 1 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 1 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 2 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 2 ][ 1 ] = 0 }else { if( sym_mvd_flag[ x0 ][ y0 ] ) { MvdL1[ x0 ][ y0 ][ 0 ] = −MvdL0[x0 ][ y0 ][ 0 ] MvdL1[ x0 ][ y0 ][ 1 ] = −MvdL0[ x0 ][ y0 ][ 1 ] } elsemvd_coding( x0, y0, 1, 0 ) if( MotionModelIdc[ x0 ][ y0 ] > 0 )mvd_coding( x0, y0, 1, 1 ) if(MotionModelIdc[ x0 ][ y0 ] > 1 )mvd_coding( x0, y0, 1, 2 ) mvp_l1_flag[ x0 ][ y0 ] ae(v) } MvdCpL1[ x0][ y0 ][ 0 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 0 ][ 1 ] = 0 MvdCpL1[ x0 ][y0 ][ 1 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 1 ][ 1 ] = 0 MvdCpL1[ x0 ][ y0][ 2 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 2 ][ 1 ] = 0 } else { if(sym_mvd_flag[ x0 ][ y0 ] ) { MvdL1[ x0 ][ y0 ][ 0 ] = −MvdL0[ x0 ][ y0][ 0 ] MvdL1[ x0 ][ y0 ][ 1 ] = −MvdL0[ x0 ][ y0 ][ 1 ] } elsemvd_coding( x0, y0, 1, 0 ) if( MotionModelIdc[ x0 ][ y0 ] > 0 )mvd_coding( x0, y0, 1, 1 ) if(MotionModelIdc[ x0 ][ y0 ] > 1 )mvd_coding( x0, y0, 1, 2 ) mvp_l1_flag[ x0 ][ y0 ] ae(v) } if(amvr_flag[ x0 ][ y0 ] ) amvr_precision_flag[ x0 ][ y0 ] ae(v) } if(sps_bcw_enabled_flag && inter_pred_idc[ x0 ][ y0 ] = = PRED_BI &&luma_weight_l0_flag[ ref_idx_l0 [ x0 ][ y0 ] ] = = 0 &&luma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] = = 0 &&chroma_weight_l0_flag[ ref_idx_l0 [ x0 ][ y0 ] ] = = 0 &&chroma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] = = 0 && cbWidth *cbHeight >= 256 ) bcw_idx[ x0 ][ y0 ] ae(v) } } if( !pcm_flag[ x0 ][ y0] ) { if( CuPredMode[ x0 ][ y0 ] != MODE_INTRA && general_merge_flag[ x0][ y0 ] = = 0 ) cu_cbf ae(v) if( cu_cbf ) { if( CuPredMode[ x0 ][ y0 ] == MODE_INTER && sps_sbt_enabled_flag && !ciip_flag[ x0 ][ y0 ] &&!MergeTriangleFlag[ x0 ][ y0 ] ) { if( cbWidth <= MaxSbtSize && cbHeight<= MaxSbtSize ) { allowSbtVerH = cbWidth >= 8 allowSbtVerQ = cbWidth >=16 allowSbtHorH = cbHeight >= 8 allowSbtHorQ = cbHeight >= 16 if(allowSbVerH | | allowSbtHorH | | allowSbtVerQ | | allowSbtHorQ )cu_sbt_flag ae(v) } if( cu_sbt_flag ) { if( ( allowSbtVerH | |allowSbtHorH ) && ( allowSbtVerQ | | allowSbtHorQ) ) cu_sbt_quad_flagae(v) if( ( cu_sbt_quad_flag && allowSbtVerQ && allowSbtHorQ ) | |  (!cu_sbt_quad_flag && allowSbtVerH && allowSbtHorH ) )cu_sbt_horizontal_flag ae(v) cu_sbt_pos_flag ae(v) } } numSigCoeff = 0numZeroOutSigCoeff = 0 transform_tree( x0, y0, cbWidth, cbHeight,treeType ) lfnstWidth = ( treeType = = DUAL_TREE_CHROMA ) ? cbWidth /SubWidthC : cbWidth lfnstHeight = ( treeType = = DUAL_TREE_CHROMA ) ?cbHeight / SubHeightC : cbHeight if( Min( lfnstWidth, lfnstHeight ) >= 4&& sps_lfnst_enabled_flag = = 1 && CuPredMode[ x0 ][ y0 ] = = MODE_INTRA&& IntraSubPartitionsSplitType = = ISP_NO_SPLIT && !intra_mip_flag[ x0][ y0 ] ) { if( ( numSigCoeff > ( ( treeType = = SINGLE_TREE ) ? 2 : 1 )) &&  numZeroOutSigCoeff = = 0 ) lfnst_idx[ x0 ][ y0 ] ae(v) } } } }

Here, cu_skip_flag may indicate whether the skip mode is applied to thecurrent block (CU).

pred_mode_flag equal to 0 specifies that the current coding unit iscoded in inter prediction mode. Pred_mode_flag equal to 1 specifies thatthe current coding unit is coded in intra prediction mode.

pred_mode_ibc_flag equal to 1 specifies that the current coding unit iscoded in IBC prediction mode. Pred_mode_ibc_flag equal to 0 specifiesthat the current coding unit is not coded in IBC prediction mode.

pcm_flag[x0][y0] equal to 1 specifies that the pcm_sample( ) syntaxstructure is present and the transform_tree( ) syntax structure is notpresent in the coding unit including the luma coding block at thelocation (x0, y0). Pcm_flag[x0][y0] equal to 0 specifies thatpcm_sample( ) syntax structure is not present. That is, pcm_flag mayrepresent whether a pulse coding modulation (PCM) mode is applied to thecurrent block. If PCM mode is applied to the current block, prediction,transformation, quantization, etc. Are not applied, and values of theoriginal sample in the current block may be coded and signaled.

intra_mip_flag[x0][y0] equal to 1 specifies that the intra predictiontype for luma samples is matrix-based intra prediction (MIP).Intra_mip_flag[x0][y0] equal to 0 specifies that the intra predictiontype for luma samples is not matrix-based intra prediction. That is,intra_mip_flag may represent whether an MIP prediction mode (type) isapplied to (a luma sample of) the current block.

intra_chroma_pred_mode[x0][y0] specifies the intra prediction mode forchroma samples in the current block.

general_merge_flag[x0][y0] specifies whether the inter predictionparameters for the current coding unit are inferred from a neighbouringinter-predicted partition. That is, general_merge_flag may representthat general merge is available, and when the value ofgeneral_merge_flag is 1, regular merge mode, mmvd mode, and mergesubblock mode (subblock merge mode) may be available. For example, whenthe value of general_merge_flag is 1, merge data syntax may be parsedfrom encoded video/image information (or bitstream), and the merge datasyntax configured/coded to include information as shown in Table 2below.

TABLE 2 Descriptor merge_data( x0, y0, cbWidth, cbHeight ) { if (CuPredMode[ x0 ][ y0 ] = = MODE_IBC ) { if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag | |cbWidth * cbHeight != 32 ) regular_merge_flag[ x0 ][ y0 ] ae(v) if (regular_merge_flag[ x0 ][ y0 ] = = 1 ){ if( MaxNumMergeCand > 1 )merge_Idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag &&cbWidth * cbHeight != 32 ) mmvd_merge_flag[ x0 ][ y0 ] ae(v) if(mmvd_merge_flag[ x0 ][ y0 ] = = 1 ) { if( MaxNumMergeCand > 1 )mmvd_cand_flag[ x0 ][ y0 ] ae(v) mmvd_distance_idx[ x0 ][ y0 ] ae(v)mmvd_direction_idx[ x0 ][ y0 ] ae(v) } else { if(MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 )merge_subblock_flag[ x0 ][ y0 ] ae(v) if( merge_subblock_flag[ x0 ][ y0] = = 1 ) { if( MaxNumSubblockMergeCand > 1 ) merge_subblock_idx[ x0 ][y0 ] ae(v) } else { if( sps_ciip_enabled_flag && cu_skip_flag[ x0 ][ y0] = = 0 && ( cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight <128 ) { ciip_flag[ x0 ][ y0 ] ae(v) if( ciip_flag[ x0 ][ y0 ] &&MaxNumMergeCand > 1 ) merge_idx[ x0 ][ y0 ] ae(v) } if(MergeTriangleFlag[ x0 ][ y0 ] ) { merge_triangle_split_dir[ x0 ][ y0 ]ae(v) merge_triangle_idx0[ x0 ][ y0 ] ae(v) merge_triangle_idx1[ x0 ][y0 ] ae(v) } } } } } }

Here, regular_merge_flag[x0][y0] equal to 1 specifies that regular mergemode is used to generate the inter prediction parameters of the currentcoding unit. That is, regular_merge_flag represents whether the mergemode (regular merge mode) is applied to the current block.

mmvd_merge_flag[x0][y0] equal to 1 specifies that merge mode with motionvector difference is used to generate the inter prediction parameters ofthe current coding unit. That is, mmvd_merge_flag represents whetherMMVD is applied to the current block.

mmvd_cand_flag[x0][y0] specifies whether the first (0) or the second (1)candidate in the merging candidate list is used with the motion vectordifference derived from mmvd_distance_idx[x0][y0] andmmvd_direction_idx[x0][y0].

mmvd_distance_idx [x0] [y0] specifies the index used to deriveMmvdDistance[x0] [y0].

mmvd_direction_idx[x0][y0] specifies index used to deriveMmvdSign[x0][y0].

merge_subblock_flag[x0][y0] specifies the subblock-based interprediction parameters for the current coding. That is,merge_subblock_flag may represents whether a subblock merge mode (oraffine merge mode) is applied to the current block.

merge_subblock_idx[x0][y0] specifies the merging candidate index of thesubblock-based merging candidate list.

ciip_flag[x0][y0] specifies whether the combined inter-picture merge andintra-picture prediction is applied for the current coding unit.

merge_triangle_idx0[x0][y0] specifies the first merging candidate indexof the triangular shape based motion compensation candidate list.

merge_triangle_idx1[x0][y0] specifies the second merging candidate indexof the triangular shape based motion compensation candidate list.

merge_idx[x0][y0] specifies the merging candidate index of the mergingcandidate list.

Meanwhile, referring back to the CU syntax of Table 1,mvp_10_flag[x0][y0] specifies the motion vector predictor index of list0. That is, when the MVP mode is applied, mvp_10_flag may represent acandidate selected for MVP derivation of the current block from the MVPcandidate list 0.

ref_idx_11[x0] [y0] has the same semantics as ref_idx_10, with 10 andlist 0 may be replaced by 11 and list 1, respectively. (ref_idx_11[x0][y0] has the same semantics as ref_idx_10, with 10, L0 and list 0replaced by 11, L1 and list 1, respectively.)

inter_pred_idc[x0][y0] specifies whether list0, list1, or bi-predictionis used for the current coding unit.

sym_mvd_flag[x0] [y0] equal to 1 specifies that the syntax elementsref_idx_10[x0] [y0] and ref_idx_11[x0][y0], and the mvd_coding(x0, y0,refList,cpIdx) syntax structure for refList equal to 1 are not present.That is, sym_mvd_flag represents whether symmetric MVD is used in mvdcoding.

ref_idx_10[x0][y0] specifies the list 0 reference picture index for thecurrent coding unit.

ref_idx_11 [x0] [y0] has the same semantics as ref_idx_10, with 10, L0and list 0 replaced by 11, L1 and list 1, respectively.

inter_affine_flag[x0][y0] equal to 1 specifies that for the currentcoding unit, when decoding a P or B slice, affine model based motioncompensation is used to generate the prediction samples of the currentcoding unit.

cu_affine_type_flag[x0][y0] equal to 1 specifies that for the currentcoding unit, when decoding a P or B slice, 6-parameter affine modelbased motion compensation is used to generate the prediction samples ofthe current coding unit. Cu_affine_type_flag[x0][y0] equal to 0specifies that 4-parameter affine model based motion compensation isused to generate the prediction samples of the current coding unit.

amvr_flag[x0][y0] specifies the resolution of motion vector difference.The array indices x0, y0 specify the location (x0, y0) of the top-leftluma sample of the considered coding block relative to the top-left lumasample of the picture. Amvr_flag[x0][y0] equal to 0 specifies that theresolution of the motion vector difference is ¼ of a luma sample.Amvr_flag[x0][y0] equal to 1 specifies that the resolution of the motionvector difference is further specified by amvr_precision_flag[x0][y0].

amvr_precision_flag[x0][y0] equal to 0 specifies that the resolution ofthe motion vector difference is one integer luma sample ifinter_affine_flag[x0][y0] is equal to 0, and 1/16 of a luma sampleotherwise. Amvr_precision_flag[x0][y0] equal to 1 specifies that theresolution of the motion vector difference is four luma samples ifinter_affine_flag[x0][y0] is equal to 0, and one integer luma sampleotherwise. The array indices x0, y0 specify the location (x0, y0) of thetop-left luma sample of the considered coding block relative to thetop-left luma sample of the picture.

bcw_idx[x0][y0] specifies the weight index of bi-prediction with CUweights.

When the (inter) prediction mode for the current block is determined,the coding apparatus derives motion information for the current blockbased on the prediction mode (S610).

The coding apparatus may perform inter prediction using motioninformation of the current block. The encoding apparatus may deriveoptimal motion information for the current block through a motionestimation procedure. For example, the encoding apparatus may search fora similar reference block with high correlation within a predeterminedsearch range in the reference picture in fractional pixel units by usingthe original block in the original picture with respect to the currentblock and derive motion information therethrough. The block similaritymay be derived based on a difference between phase-based sample values.For example, the block similarity may be calculated based on the SADbetween the current block (or the template of the current block) and thereference block (or the template of the reference block). In this case,motion information may be derived based on a reference block having thesmallest SAD in the search area. The derived motion information may besignaled to the decoding apparatus according to various methods based onthe inter prediction mode.

When the motion information on the current block is derived, the codingapparatus performs inter prediction based on the motion information onthe current block (S620). The coding apparatus may derive predictionsample(s) for the current block based on the motion information. Thecurrent block including the prediction samples may be referred to as apredicted block.

Reconstructed samples and a reconstructed picture may be generated basedon the derived prediction samples, and then procedures such as in-loopfiltering may be performed.

FIG. 7 is a diagram illustrating a merge mode and a skip mode that maybe used for inter prediction.

When a merge mode is applied during inter prediction, motion informationof the current block is not directly transmitted, but motion informationof the current block is derived using motion information of aneighboring prediction block. Accordingly, the encoding apparatus mayindicate motion information of the current block by transmitting flaginformation indicating that the merge mode is used and a merge indexindicating which of the surrounding prediction blocks is used. The mergemode may be referred to as a regular merge mode.

In order to perform the merge mode, the coding apparatus searches for amerge candidate block used to derive motion information of the currentblock. For example, up to five merge candidate blocks may be used, butthe present embodiment is not limited thereto. Also, information on themaximum number of merge candidate blocks may be transmitted in a sliceheader or a tile group header, but the present embodiment is not limitedthereto. After finding the merge candidate blocks, the coding apparatusmay generate a merge candidate list and may select a merge candidateblock having the smallest cost, among the merge candidate blocks, as afinal merge candidate block.

This document provides various embodiments of merge candidate blocksconstituting the merge candidate list.

The merge candidate list may include, for example, five merge candidateblocks. For example, four spatial merge candidates and one temporalmerge candidate may be used. As a specific example, in the case of aspatial merge candidate, blocks A₀, A₁, B₀, B₁, and B₂ shown in FIG. 7may be used as spatial merge candidates. Hereinafter, the spatial mergecandidate or a spatial MVP candidate to be described later may bereferred to as an SMVP, and the temporal merge candidate or a temporalMVP candidate to be described later may be referred to as a TMVP.

The merge candidate list for the current block may be constructed, forexample, based on the following procedure.

FIG. 8 schematically shows a method for configuring a merge candidatelist.

First, the coding apparatus (encoding apparatus/decoding apparatus) mayinsert spatial merge candidates derived by searching for spatialneighboring blocks of the current block into the merge candidate list(S810). For example, the spatial neighboring blocks may include alower-left corner neighboring block A₀, a left neighboring block A₁, anupper-right corner neighboring block B₀, an upper neighboring block B₁,and an upper-left corner neighboring block B₂ of the current block.However, this is an example, and in addition to the spatial neighboringblocks described above, additional neighboring blocks such as a rightneighboring block, a lower neighboring block, and a lower-rightneighboring block may be further used as the spatial neighboring blocks.The coding apparatus may detect available blocks by searching thespatial neighboring blocks based on priorities, and may derive motioninformation of the detected blocks as the spatial merge candidates. Forexample, the encoding apparatus and/or the decoding apparatus may searchfor five blocks shown in FIG. 7 in the order of A₁, B₁, B₀, A₀, and B₂,and sequentially indexes the available candidates to form a mergecandidate list.

Also, the coding apparatus may insert a temporal merge candidate derivedby searching for a temporal neighboring block of the current block intothe merge candidate list (S820). The temporal neighboring block may belocated on a reference picture that is a different picture from thecurrent picture in which the current block is located. The referencepicture in which the temporal neighboring block is located may be calleda collocated picture or a col picture. The temporal neighboring blockmay be searched for in the order of a lower-right corner neighboringblock and a lower-right center block of a co-located block with respectto the current block on the col picture.

Meanwhile, when motion data compression is applied, specific motioninformation may be stored as representative motion information for eachpredetermined storage unit in the col picture. In this case, there is noneed to store motion information for all blocks in the predeterminedstorage unit, and through this, a motion data compression effect may beobtained. In this case, the predetermined storage unit may be previouslydetermined as, for example, a 16×16 sample unit or an 8×8 sample unit,or size information on the predetermined storage unit may be signaledfrom the encoding apparatus to the decoding apparatus. When the motiondata compression is applied, the motion information of the temporalneighboring block may be replaced with representative motion informationof the predetermined storage unit in which the temporal neighboringblock is located. That is, in this case, from an implementation point ofview, the temporal merge candidate may be derived based on motioninformation of a prediction block covering an arithmetic left shiftedposition after an arithmetic right shift by a certain value based on thecoordinates (upper-left sample position) of the temporal neighboringblock, rather than a prediction block located at the coordinates of thetemporal neighboring block. For example, when the predetermined storageunit is a 2^(n)×2^(n) sample unit, if the coordinates of the temporalneighboring block are (xTnb, yTnb), motion information of a predictionblock located at ((xTnb>>n)<<n), (yTnb>>n)<<n)) may be used for thetemporal merge candidate. Specifically, for example, when thepredetermined storage unit is a 16×16 sample unit, if the coordinates ofthe temporal neighboring block are (xTnb, yTnb), motion information ofthe prediction block located at modified position ((xTnb>>4)<<4),(yTnb>>4)<<4)) may be used for the temporal merge candidate Or, forexample, when the predetermined storage unit is an 8×8 sample unit, ifthe coordinates of the temporal neighboring block are (xTnb, yTnb),motion information of the prediction block located at modified position((xTnb>>3)<<3), (yTnb>>3)<<3)) may be used for the temporal mergecandidate.

Meanwhile, the coding apparatus may determine whether the number ofcurrent merge candidates is smaller than a maximum number of mergecandidates (S830). The maximum number of merge candidates may bepredefined or signaled from the encoding apparatus to the decodingapparatus. For example, the encoding apparatus may generate informationon the maximum number of merge candidates, encode the same, and transmitthe encoded information to the decoding apparatus in the form of abitstream. When the maximum number of merge candidates is filled, asubsequent candidate adding process may not be performed.

As a result of the determination, if the number of the current mergecandidates is smaller than the maximum number of merge candidates, thecoding apparatus may insert an additional merge candidate into the mergecandidate list (S840). The additional merge candidates may include atleast one of, for example, history based merge candidate(s), pair-wiseaverage merge candidate(s), ATMVP, and combined bi-predictive mergecandidates (in a case in which a slice/tile group type of a currentslice/tile group is type B) and/or a zero vector merge candidate.

As a result of the determination, if the number of the current mergecandidates is not smaller than the maximum number of merge candidates,the coding apparatus may terminate the configuration of the mergecandidate list (S850). In this case, the encoding apparatus may selectan optimal merge candidate from among the merge candidates constitutingthe merge candidate list based on a rate-distortion (RD) cost, andsignal selection information (e.g., merge index) indicating the selectedmerge candidate to the decoding apparatus. The decoding apparatus mayselect the optimal merge candidate based on the merge candidate list andthe selection information.

The motion information of the selected merge candidate may be used asthe motion information of the current block, and prediction samples ofthe current block may be derived based on the motion information of thecurrent block. The encoding apparatus may derive residual samples of thecurrent block based on the prediction samples, and may signal residualinformation on the residual samples to the decoding apparatus. Asdescribed above, the decoding apparatus may generate reconstructedsamples based on the residual samples derived based on the residualinformation and the prediction samples, and generate a reconstructedpicture based thereon.

When a skip mode is applied during inter prediction, motion informationof the current block may be derived in the same manner as when the mergemode is applied. However, when the skip mode is applied, the residualsignal for the corresponding block may be omitted, and thus theprediction samples may be directly used as the reconstructed samples.

Meanwhile, an addition to merge mode, where the implicitly derivedmotion information is directly used for prediction samples generation ofthe current CU, the merge mode with motion vector differences (MMVD) isintroduced in VVC. Because similar motion information derivation methodsare used for the skip mode and the merge mode, MMVD may be applied tothe skip mode. An MMVD flag (ex. Mmvd_flag) may be signaled right aftersending a skip flag and merge flag to specify whether MMVD mode is usedfor a CU.

In MMVD, after a merge candidate is selected, it is further refined bythe signaled MVDs information. When MMVD is applied to the current block(i.e. When the mmvd_flag is equal to 1), further information for theMMVD may be signaled.

The further information includes a merge candidate flag (ex.Mmvd_merge_flag) indicating whether the first (0) or the second (1)candidate in the merging candidate list is used with the motion vectordifference, an index to specify motion magnitude (ex.Mmvd_distance_idx), and an index for indication of motion direction (ex.Mmvd_direction_idx). In MMVD mode, one for the first two candidates inthe merge list is selected to be used as MV basis. The merge candidateflag is signaled to specify which one is used.

Distance index specifies motion magnitude information and indicate thepre-defined offset from the starting point.

An offset is added to either horizontal component or vertical componentof starting MV. The relation of distance index and pre-defined offset isspecified in Table 3.

TABLE 3 MmvdDistance[ x0 ][ y0 ] mmvd_distance_idx[ x0 ][ y0 ]slice_fpel_mmvd_enabled_flag = = 0 slice_fpel_mmvd_enabled_flag = = 1 01 4 1 2 8 2 4 16 3 8 32 4 16 64 5 32 128 6 64 256 7 128 512

Here, slice_fpel_mmvd_enabled_flag equal to 1 specifies that merge modewith motion vector difference uses integer sample precision in thecurrent slice. Slice_fpel_mmvd_enabled_flag equal to 0 specifies thatmerge mode with motion vector difference may use fractional sampleprecision in the current slice. When not present, the value ofslice_fpel_mmvd_enabled_flag is inferred to be 0.Slice_fpel_mmvd_enabled_flag syntax element may be signaled through (maybe comprised in) a slice header.

Direction index represents the direction of the MVD relative to thestarting point. The direction index may represent of the four directionsas shown in Table 4. It's noted that the meaning of MVD sign could bevariant according to the information of starting MVs. When the startingMVs is an un-prediction MV or bi-prediction MVs with both lists point tothe same side of the current picture (i.e. POCs of two references areboth larger than the POC of the current picture, or are both smallerthan the POC of the current picture), the sign in Table 4 specifies thesign of MV offset added to the starting MV. When the starting MVs is anun-prediction MV or bi-prediction MVs with both lists point to the sameside of the current picture (i.e. POCs of two references are both largerthan the POC of the current picture, or are both smaller than the POC ofthe current picture), the sign in Table 4 specifies the sign of MVoffset added to the starting MV.

TABLE 4 mmvd_direction_idx[ x0 ][ y0 ] MmvdSign[ x0 ][ y0 ][0] MmvdSign[x0 ][ y0 ][1] 0 +1 0 1 −1 0 2 0 +1 3 0 −1

Both components of the merge plus MVD offset MmvdOffset[x0][y0] arederived as follows.

MmvdOffset[x0][y0][0]=(MmvdDistance[x0][y0]<<2)*MmvdSign[x0][y0][0]

MmvdOffset[x0][y0][1]=(MmvdDistance[x0][y0]<<2)*MmvdSign[x0][y0][1]  [Equation1]

FIG. 9 is a diagram illustrating a subblock-based temporal motion vectorprediction process that may be used in inter prediction.

Subblock-based temporal motion vector prediction (SbTMVP) method may beused for inter prediction. Similar to the temporal motion vectorprediction (TMVP), SbTMVP uses the motion field in the collocatedpicture to improve motion vector prediction and merge mode for CUs inthe current picture. The same collocated picture used by TMVP is usedfor SbTVMP. SbTMVP differs from TMVP in the following two main aspects.

1. TMVP predicts motion at CU level but SbTMVP predicts motion at sub-CUlevel.

2. Whereas TMVP fetches the temporal motion vectors from the collocatedblock in the collocated picture (the collocated block is thebottom-right or center (below-right center) block relative to thecurrent CU), SbTMVP applies a motion shift before fetching the temporalmotion information from the collocated picture, where the motion shiftis obtained from the motion vector from one of the spatial neighbouringblocks of the current CU.

SbTMVP predicts the motion vectors of the sub-CUs within the current CUin two steps. In the first step, the spatial neighbour A1 is examined.If A1 has a motion vector that uses the collocated picture as itsreference picture is identified, this motion vector (may be referred toas a temporal MV (tempVM)) is selected to be the motion shift to beapplied. If no such motion is identified, then the motion shift is setto (0, 0).

In the second step, the motion shift identified in Step 1 is applied(i.e. Added to the current block's coordinates) to obtain sub-CU-levelmotion information (motion vectors and reference indices) from thecollocated picture as shown in FIG. 9. The example in FIG. 9 assumes themotion shift is set to block A1's motion. Then, for each sub-CU, themotion information of its corresponding block (the smallest motion gridthat covers the center sample) in the collocated picture is used toderive the motion information for the sub-CU. The center sample (belowright center sample) may correspond to a below-right sample among 4central samples in the sub-CU when the sub-block has even length widthand height.

After the motion information of the collocated sub-CU is identified, itis converted to the motion vectors and reference indices of the currentsub-CU in a similar way as the TMVP process, where temporal motionscaling may be applied to align the reference pictures of the temporalmotion vectors to those of the current CU.

A combined sub-block based merge list which contains both SbTVMPcandidate and affine merge candidates may be used for the signalling ofaffine merge mode (may be referred to as sub-block (based) merge mode).The SbTVMP mode is enabled/disabled by a sequence parameter set (SPS)flag. If the SbTMVP mode is enabled, the SbTMVP predictor is added asthe first entry of the list of sub-block merge candidates, and followedby the affine merge candidates. The maximum allowed size of the affinemerge candidate list may be 5.

The sub-CU size used in SbTMVP may be fixed to be 8×8, and as done foraffine merge mode, SbTMVP mode may be only applicable to the CU withboth width and height are larger than or equal to 8.

The encoding logic of the additional SbTMVP merge candidate is the sameas for the other merge candidates, that is, for each CU in P or B slice,an additional RD check may be performed to decide whether to use theSbTMVP candidate.

Meanwhile, a triangle partition mode may be used for inter prediction.The triangle partition mode may be only applied to CUs that are 8×8 orlarger. The triangle partition mode is signalled using a CU-level flagas one kind of merge mode, with other merge modes including the regularmerge mode, the MMVD mode, the CIIP mode and the subblock merge mode.

When this mode is used, a CU may be split evenly into twotriangle-shaped partitions, using either the diagonal split or theanti-diagonal split. Each triangle partition in the CU isinter-predicted using its own motion; only uni-prediction is allowed foreach partition, that is, each partition has one motion vector and onereference index. The uni-prediction motion constraint is applied toensure that same as the conventional bi-prediction, only two motioncompensated prediction are needed for each CU.

If triangle partition mode is used for the current CU, then a flagindicating the direction of the triangle partition (diagonal oranti-diagonal), and two merge indices (one for each partition) arefurther signalled. The number of maximum TPM candidate size is signalledexplicitly at slice level and specifies syntax binarization for TMPmerge indices. After predicting each of the triangle partitions, thesample values along the diagonal or anti-diagonal edge are adjustedusing a blending processing with adaptive weights. This is theprediction signal for the whole CU, and transform and quantizationprocess will be applied to the whole CU as in other prediction modes.Finally, the motion field of a CU predicted using the triangle partitionmode is stored in 4×4 units. The triangle partition mode is not used incombination with SBT, that is, when the signalled triangle mode is equalto 1, the cu_sbt_flag is inferred to be 0 without signalling.

The uni-prediction candidate list is derived directly from the mergecandidate list constructed as described above.

After predicting each triangle partition using its own motion, blendingis applied to the two prediction signals to derive samples around thediagonal or anti-diagonal edge.

In addition, combined inter and intra prediction may be applied to acurrent block. An additional flag (ex. Ciip_flag) may be signalled toindicate if the combined inter/intra prediction (CIIP) mode is appliedto the current CU. For example, when a CU is coded in merge mode, if theCU contains at least 64 luma samples (that is, CU width times CU heightis equal to or larger than 64), and if both CU width and CU height areless than 128 luma samples, the additional flag is signalled to indicateif the combined inter/intra prediction (CIIP) mode is applied to thecurrent CU. As its name indicates, the CIIP prediction combines an interprediction signal with an intra prediction signal. The inter predictionsignal in the CIIP mode P_inter is derived using the same interprediction process applied to regular merge mode; and the intraprediction signal P_intra is derived following the regular intraprediction process with the planar mode. Then, the intra and interprediction signals are combined using weighted averaging, where theweight value is calculated depending on the coding modes of the top andleft neighbouring blocks as follows.

If the top neighbor is available and intra coded, then set isIntraTop to1, otherwise set isIntraTop to 0.

If the left neighbor is available and intra coded, then set isIntraLeftto 1, otherwise set isIntraLeft to 0.

If (isIntraLeft+isIntraLeft) is equal to 2, then wt is set to 3.

Otherwise, if (isIntraLeft+isIntraLeft) is equal to 1, then wt is set to2.

Otherwise, if (isIntraLeft+isIntraLeft) is equal to 1, then wt is set to2.

The CIIP prediction is formed as follows.

P _(CIIP)=((4−wt)*P _(inter) +wt*P _(intra)+2)>>2  [Equation 2]

Meanwhile, in order to generate a prediction block, the coding apparatusmay derive motion information based on the regular merge mode, skipmode, SbTMVP mode, MMVD mode, triangle partition mode (partitioningmode) and/or CIIP mode as described above. Each mode may beenabled/disabled through an on/off flag for each mode included in thesequence parameter set (SPS). If the on/off flag for a specific mode isdisabled, the encoding apparatus does not signal a syntax explicitlytransmitted for the corresponding prediction mode in units of CUs orPUs.

Therefore, when all of the specific modes for the merge/skip mode aredisabled or partially disabled in the existing operation process, aproblem in which the on/off flag is signaled redundantly arises.Therefore, in this document, in order to prevent the same information(flag) from being signaled redundantly in the process of selecting themerge mode applied to the current block based on the merge data syntaxof Table 2, any one of the following methods may be used.

The encoding apparatus may signal a flag based on a sequence parameterset as shown in Table 5 below in order to select a prediction mode thatmay be used in the process of deriving motion information. Eachprediction mode may be turned on/off based on the sequence parameter setof Table 5, and each syntax element of the merge data syntax of Table 2may be parsed or may be induced according to a condition in which theflag of Table 5 and each mode are used.

TABLE 5 Descriptor seq_parameter_set_rbsp( ) {sps_decoding_parameter_set_id u(4) sps_max_sub_layers_minus1 u(3)sps_reserved_zero_5bits u(5) profile_tier_level(sps_max_sub_layers_minus1 ) gra_enabled_flag u(1)sps_seq_parameter_set_id ue(v) chroma_format_idc ue(v) if(chroma_format_idc = = 3 ) separate_colour_plane_flag u(1)pic_width_in_luma_samples ue(v) pic_height_in_luma_samples ue(v)conformance_window_flag u(1) if( conformance_window_flag ) {conf_win_left_offset ue(v) conf_win_right_offset ue(v)conf_win_top_offset ue(v) conf_win_bottom_offset ue(v) }bit_depth_luma_minus8 ue(v) bit_depth_chroma_minus8 ue(v)log2_max_pic_order_cnt_lsb_minus4 ue(v)sps_sub_layer_ordering_info_present_flag u(1) for( i = (sps_sub_layer_ordering_info_present_flag ? 0 : sps_max_sub_layers_minus1); i <= sps_max_sub_layers_minus1; i++ ) {sps_max_dec_pic_buffering_minus1[ i ] ue(v) sps_max_num_reorder_pics[ i] ue(v) sps_max_lateney_increase_plus1[ i ] ue(v) }long_term_ref_pics_flag u(1) sps_idr_rpl_present_flag u(1)rpl1_same_as_rpl0_flag u(1) for( i = 0; i < !rpl1_same_as_rpl0_flag ? 2: 1; i++ ) { num_ref_pic_lists_in_sps[ i ] ue(v) for( j = 0; j <num_refo_pic_lists_in_sps[ i ]; j++) ref_pic_list_struct( i, j ) }qtbtt_dual_tree_intra_flag u(1) log2_ctu_size_minus2 ue(v)log2_min_luma_coding_block_size_minus2 ue(v)partition_constraints_override_enabled_flag u(1)sps_log2_diff_min_qt_min_cb_intra_slice_luma ue(v)sps_log2_diff_min_qt_min_cb_inter_slice ue(v)sps_max_mtt_hierarchy_depth_inter_slice ue(v)sps_max_mtt_hierarchy_depth_intra_slice_luma ue(v) if(sps_max_mtt_hierarchy_depth_intra_slice_luma != 0 ) {sps_log2_diff_max_bt_min_qt_intra_slice_luma ue(v)sps_log2_diff_max_tt_min_qt_intra_slice_luma ue(v) } if(sps_max_mtt_hierarchy_depth_inter_slices != 0 ) {sps_log2_diff_max_bt_min_qd_inter_slice ue(v)sps_log2_diff_max_tt_min_qt_inter_slice ue(v) } if(qtbtt_dual_tree_intra_flag ) {sps_log2_diff_min_qt_min_cb_intra_slice_chroma ue(v)sps_max_mtt_hierarchy_depth_intra_slice_chroma ue(v) if (sps_max_mtt_hierarchy_depth_intra_slice_chroma != 0 ) {sps_log2_diff_max_bt_min_qt_intra_slice_chroma ue(v)sps_log2_diff_max_tt_min_qt_intra_slice_chroma ue(v) } }sps_sao_enabled_flag u(1) sps_alf_enabled_flag u(1) sps_pcm_enabled_flagu(1) if( sps_pcm_enabled_flag ) { pcm_sample_bit_depth_luma_minus1 u(4)pcm_sample_bit_depth_chroma_minus1 u(4)log2_min_pcm_luma_coding_block_size_minus3 ue(v)log2_diff_max_min_pcm_luma_coding_block_size ue(v)pcm_loop_filter_disabled_flag u(1) } if( ( CtbSizeY / MinCbSizeY + 1) <=( pic_width_in_luma_samples / MinCbSizeY − 1 ) ) {sps_ref_wraparound_enabled_flag u(1) if( sps_ref_wraparound_enabled_flag) sps_ref_wraparound_offset_minus1 ue(v) } sps_temporal_mvp_enabled_flagu(1) if( sps_temporal_mvp_enabled_flag ) sps_sbtmvp_enabled_flag u(1)sps_amvr_enabled_flag u(1) sps_bdof_enabled_flag u(1)sps_smvd_enabled_flag u(1) sps_affine_amvr_enabled_flag u(1)sps_dmvr_enabled_flag u(1) sps_mmvd_enabled_flag u(1)sps_cclm_enabled_flag if( sps_cclm_enabled_flag && chroma_format_idc = =1 ) sps_cclm_colocated_chroma_flag u(1) sps_mts_enabled_flag u(1) if(sps_mts_enabled_flag ) { sps_explicit_mts_intra_enabled_flag u(1)sps_explicit_mts_inter_enabled_flag u(1) } sps_sbt_enabled_flag u(1) if(sps_sbt_enabled_flag ) sps_sbt_max_size_64_flag u(1)sps_affine_enabled_flag u(1) if( sps_affine_enabled_flag )sps_affine_type_flag u(1) sps_gbi_enabled_flag u(1) sps_ibc_enabled_flagu(1) sps_ciip_enabled_flag u(1) if( sps_mmvd_enabled_flag )sps_fpel_mmvd_enabled_flag u(1) sps_triangle_enabled_flag u(1)sps_lmcs_enabled_flag u(1) sps_ladf_enabled_flag u(1) if (sps_ladf_enabled_flag ) { sps_num_ladf_intervals_minus2 u(2)sps_ladf_lowest_interval_qp_offset se(v) for( i = 0; i <sps_num_ladf_intervals_minus2 + 1; i++ ) { sps_ladf_qp_offset[ i ] se(v)sps_ladf_delta_threshold_minus1[ i ] ue(v) } } sps_extension_flag u(1)if( sps_extension_flag ) while( more_rbsp_data( ) )sps_extension_data_flag u(1) rbsp_railing_bits( ) }

The following drawings are prepared to explain a specific example ofthis document. Since the names of specific devices or names of specificsignals/information described in the drawings are presented by way ofexample, the technical features of the present disclosure are notlimited to the specific names used in the following drawings.

FIGS. 10 and 11 schematically show an example of a video/image encodingmethod including an inter prediction method and related componentsaccording to an embodiment of the present document.

The encoding method disclosed in FIG. 10 may be performed by theencoding apparatus 200 illustrated in FIG. 2. Specifically, for example,steps S1000 and S1010 of FIG. 10 may be performed by the predictor 220of the encoding apparatus 200, steps S1020 and S1030 may be performed bythe residual processor 230 of the encoding apparatus 200, and step S1040may be performed by the entropy encoder 240 of the encoding apparatus200. The encoding method disclosed in FIG. 10 may include theembodiments described above in this document.

Specifically, referring to FIGS. 10 and 11, the predictor of theencoding apparatus may derive prediction samples of the current blockbased on inter prediction (S1000). As an example, the predictor of theencoding apparatus may derive prediction samples for the current blockusing any one inter prediction mode among a regular merge mode, a skipmode, an MMVD mode, a subblock merge mode, a partitioning mode, and aCIIP mode.

Here, the regular merge mode may be defined as a mode in which motioninformation of the current block is derived using motion information ofa neighboring block. The skip mode may be defined as a mode in which aprediction block is used as a reconstructed block. The MMVD mode isapplied to the merge mode or the skip mode and may be defined as a merge(or skip) mode using a motion vector difference. The subblock merge modemay be defined as a merge mode based on a subblock. The partitioningmode may be defined as a mode for performing prediction by dividing thecurrent block into two partitions (diagonal or anti-diagonal). The CIIPmode may be defined as a mode in which inter-picture merge andintra-picture prediction are combined.

Meanwhile, the predictor of the encoding apparatus may search for ablock similar to the current block within a certain region (searchregion) of reference pictures through motion estimation, derive areference block having a difference which is minimum or a certainreference or less from the current block, and derive a reference pictureindex indicating a reference picture in which the reference block ispositioned based thereon. In addition, a motion vector may be derivedbased on a position difference between the reference block and thecurrent block.

The predictor of the encoding apparatus may generate prediction samples(prediction block) of the current block based on the prediction mode ofthe current block and the motion vector of the current block. Inaddition, the predictor of the encoding apparatus may generateinformation on the prediction mode indicating the prediction mode(S1010). Here, the information on the prediction mode may includeinter/intra prediction classification information, inter prediction modeinformation, and the like, and may include various syntax elementsrelated thereto.

The residual processor of the encoding apparatus may derive residualsamples based on original samples (original block) of the current blockand prediction samples (prediction block) of the current block (S1020).In addition, information on the residual samples may be generated basedon the residual samples (S1030).

The encoder of the encoding apparatus may encode image informationincluding information on the residual samples, information on theprediction mode, and the like (S1040). The image information may includepartitioning related information, information on a prediction mode,residual information, in-loop filtering related information, and thelike, and may include various syntax elements related thereto.Information encoded by the encoder of the encoding apparatus may beoutput in the form of a bitstream. The bitstream may be transmitted tothe decoding apparatus through a network or a storage medium.

For example, the image information may include information on variousparameter sets, such as an adaptation parameter set (APS), a pictureparameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). In addition, the image information may includeinformation on the prediction mode of the current block, such as acoding unit syntax and merge data syntax. Here, the sequence parameterset may include a combined inter-picture merge and intra-pictureprediction (CIIP) enabled flag, a partitioning mode enabled flag, andthe like. The coding unit syntax may include a CU skip flag indicatingwhether the skip mode is applied to the current block.

According to an embodiment, as an example, the encoding apparatus mayinclude a regular merge flag in the image information based on that acondition based on the CIIP enabled flag and a condition based on a sizeof the current block is satisfied so that the same syntax is notrepeatedly transmitted. Here, the condition based on the size of thecurrent block may be a case in which a product of a height of thecurrent block and a width of the current block is 64 or greater and theheight of the current block and the width of the current block are eachsmaller than 128. The condition based on the CIIP enabled flag may be acase in which a value of the CIIP enabled flag is 1. In other words,when the product of the height of the current block and the width of thecurrent block is 64 or greater, the height of the current block and thewidth of the current block are each smaller than 128, and the value ofthe CIIP enabled flag is 1, the encoding apparatus may then signal theregular merge flag.

As another example, the encoding apparatus may include the regular mergeflag in the image information based on that a condition based on the CUskip flag and the size of the current block is satisfied. Here, thecondition based on the CU skip flag may be a case in which a value ofthe CU skip flag is 0. In other words, when the product of the height ofthe current block and the width of the current block is 64 or greater,the height of the current block and the width of the current block aresmaller than 128, and the value of the CU skip flag is 0, the encodingapparatus may then signal the regular merge flag.

As another example, the encoding apparatus may include the regular mergeflag in the image information based on that at least one of thecondition based on the CIIP enabled flag and the condition based on theCU skip flag and the condition based on the size of the current blockare satisfied. Here, the condition based on the CIIP enabled flag may bea case in which a value of the CIIP enabled flag is 1. The conditionbased on the CU skip flag may be a case in which a value of the CU skipflag is 0. In other words, when the product of the height of the currentblock and the width of the current block is 64 or greater, the height ofthe current block and the width of the current block each are smallerthan 128, the value of the CIIP enabled flag is 1, or when the value ofthe CU skip flag is 0, the encoding apparatus may signal the regularmerge flag.

As another example, the encoding apparatus may include the regular mergeflag in the image information based on that the condition based on theCU skip flag is further satisfied in addition to the condition based onthe CIIP enabled flag and the condition based on the size of the currentblock. Here, the condition based on the CU skip flag may be a case inwhich the value of the CU skip flag is 0. In other words, when theproduct of the height of the current block and the width of the currentblock is 64 or greater, the height of the current block and the width ofthe current block are less than 128, the value of the CIIP enabled flagis 1, and a value of the CU skip flag is 0, the encoding apparatus maythen signal the regular merge flag.

As another example, the encoding apparatus may include a regular mergeflag in the image information based on that a condition based on theinformation on the current block and the partitioning mode enabled flagis satisfied. Here, the condition based on the information on thecurrent block may include a case in which the product of the width andthe height of the current block is 64 or greater and/or a case in whicha slice type including the current block is a B slice. The conditionbased on the partitioning mode enabled flag may be a case in which thevalue of the partitioning mode enabled flag is 1. In other words, whenboth the condition based on the height of the current block andinformation on the current block and the condition based on thepartitioning mode enabled flag are satisfied, the encoding apparatus maysignal the regular merge flag.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the encodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag issatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag is notsatisfied, the encoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

Meanwhile, when the product of the width and height of the current blockis not 32 and the value of the MMVD enabled flag is 1 or when themaximum number of subblock merge candidates is greater than 0 and thewidth and height of the current block are 8 or greater, the encodingapparatus may signal the regular merge flag.

To this end, as an example, the merge data syntax may be configured asshown in Table 6 below.

TABLE 6 Descriptor merge_data( x0, y0, cbWidth, cbHeight ) { if (CuPredMode[ x0 ][ y0 ] = = MODE_IBC ) { if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if((cbWidth * cbHeight !=32) &&((sps_mmvd_enabled_flag) || (MaxNumSubblockMergeCand > 0 && cbWidth >= 8&& cbHeight >= 8) || (sps_ciip_enabled_flag && cu_skip_flag[ x0 ][ y0 ]= = 0 && (cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight < 128)|| (sps_triangle_enabled_flag && cbWidth * cbHeight>=64 &&MaxNumTriangleMergeCand>=2 && slice_type = = B_SLICE)))regular_merge_flag[ x0 ][ y0 ] ae(v) if ( regular_merge_flag[ x0 ][ y0 ]= = 1 ){ if( MaxNumMergeCand > 1 ) merge_idx[ x0 ][ y0 ] ae(v) } else {if( sps_mmvd_enabled_flag && cbWidth * cbHeight != 32 ) mmvd_merge_flag[x0 ][ y0 ] ae(v) if( mmvd_merge_flag[ x0 ][ y0 ] = = 1 ) { if(MaxNumMergeCand > 1 ) mmvd_cand_flag[ x0 ][ y0 ] ae(v)mmvd_distance_idx[ x0 ][ y0 ] ae(v) mmvd_direction_idx[ x0 ][ y0 ] ae(v)} else { if( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >=8 ) merge_subblock_flag[ x0 ][ y0 ] ae(v) if( merge_subblock_flag[ x0 ][y0 ] = = 1 ) { if( MaxNumSubblockMergeCand > 1 ) merge_subblock_idx[ x0][ y0 ] ae(v) } else { if( sps_ciip_enabled_flag && cu_skip_flag[ x0 ][y0 ] = = 0 && ( cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight< 128 ) { ciip_flag[ x0 ][ y0 ] ae(v) if( ciip_flag[ x0 ][ y0 ] &&MaxNumMergeCand > 1 ) merge_idx[ x0 ][ y0 ] ae(v) } if(MergeTriangleFlag[ x0 ][ y0 ] ) { merge_triangle_split_dir[ x0 ][ y0 ]ae(v) merge_triangle_idx0[ x0 ][ y0 ] ae(v) merge_triangle_idx1[ x0 ][y0 ] ae(v) } } } } } }

In Table 6, regular_merge_flag[x0][y0] equal to 1 specifies that regularmerge mode is used to generate the inter prediction parameters of thecurrent coding unit. The array indices x0, y0 specify the location (x0,y0) of the top-left luma sample of the considered coding block relativeto the top-left luma sample of the picture.

When regular_merge_flag[x0][y0] is not present, it is inferred asfollows.

If all of the following conditions are true, regular_merge_flag[x0][y0]is inferred to be equal to 1.

-   -   general_merge_flag[x0][y0] is equal to 1    -   sps_mmvd_enable_flag is equal to 0 or cbWidth*cbHeight==32)    -   MaxNumSubblockMergeCand<=0 or cbWidth<8 or cbHeight<8    -   sps_ciip_enabled_flag is equal to 0 or cbWidth*cbHeight<64 or        cbWidth>=128 or cbHeight>=128 or cu_skip_flag[x0][y0] is equal        to 1    -   sps_triangle_enabled_flag is equal to 0 or        MaxNumTriangleMergeCand<2 or slice_type is not equal to B_SLICE

Otherwise, regular_merge_flag[x0][y0] is inferred to be equal to 0.

Meanwhile, according to another embodiment, as an example, the encodingapparatus may include the MMVD merge flag in the image information basedon that the condition based on the CIIP enabled flag and the conditionbased on the size of the current block is satisfied so that the samesyntax is not repeatedly transmitted. Here, the condition based on thesize of the current block may be a case in which the product of theheight of the current block and the width of the current block is 64 orgreater and the height of the current block and the width of the currentblock are each smaller than 128. The condition based on the CIIP enabledflag may be a case in which the value of the CIIP enabled flag is 1. Inother words, when the product of the height of the current block and thewidth of the current block is 64 or greater, the height of the currentblock and the width of the current block are smaller than 128, and thevalue of the CIIP enabled flag is 1, the encoding apparatus may signalthe MMVD merge flag.

As another example, the encoding apparatus may include the MMVD mergeflag in the image information based on that the condition based on theCU skip flag is further satisfied in addition to the condition based onthe CIIP enabled flag and the condition based on the size of the currentblock. Here, the condition based on the CU skip flag may be a case inwhich the value of the CU skip flag is 0. In other words, when theproduct of the height of the current block and the width of the currentblock is 64 or greater, the height of the current block and the width ofthe current block are each smaller than 128, the value of the CIIPenabled flag is 1, and the value of the CU skip flag is 0, the encodingapparatus may then signal the MMVD merge flag.

As another example, the encoding apparatus may include the MMVD mergeflag in the image information based on that the condition based on theinformation on the current block and the partitioning mode enabled flagare satisfied. Here, the condition based on the information on thecurrent block may include the case in which the product of the width andthe height of the current block is 64 or greater and/or a case in whicha slice type including the current block is a B slice. The conditionbased on the partitioning mode enabled flag may be a case in which thevalue of the partitioning mode enabled flag is 1. In other words, theencoding apparatus may signal the MMVD merge flag when both thecondition based on the height of the current block and information onthe current block and the condition based on the partitioning modeenabled flag are satisfied.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the encodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag aresatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag are notsatisfied, the encoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

Meanwhile, when the product of the width and height of the current blockis not 32 and the value of the MMVD enabled flag is 1 or when themaximum number of subblock merge candidates is greater than 0 and thewidth and height of the current block are 8 or greater, the encodingapparatus may signal the MMVD merge flag.

To this end, as an example, the merge data syntax may be configured asshown in Table 7 below.

TABLE 7 Descriptor merge_data( x0, y0, cbWidth, chHeight ) { if (CuPredMode[ x0 ][ y0 ] = = MODE_IBC ) { if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag | |cbWidth * cbHeight != 32 ) regular_merge_flag[ x0 ][ y0 ] ae(v) if (regular_merge_flag[ x0 ][ y0 ] = = 1 ){ if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( (sps_mmvd_enabled_flag &&cbWidth * cbHeight != 32 ) || (MaxNumSubblockMergeCand > 0 && cbWidth >=8 && cbHeight >= 8) || (sps_ciip_enabled_flag && cu_skip_flag[ x0 ][ y0] = = 0 && (cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight <128) || (sps_triangle_enabled_flag && cbWidth * cbHeight>=64 &&MaxNumTriangleMergeCand>=2 && slice_type = = B_SLICE) ) mmvd_merge_flag[x0 ][ y0 ] ae(v) if( mmvd_merge_flag[ x0 ][ y0 ] = = 1 ) { if(MaxNumMergeCand > 1 ) mmvd_cand_flag[ x0 ][ y0 ] ae(v)mmvd_distance_idx[ x0 ][ y0 ] ae(v) mmvd_direction_idx[ x0 ][ y0 ] ae(v)} else { if( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >=8 ) merge_subblock_flag[ x0 ][ y0 ] ae(v) if( merge_subblock_flag[ x0 ][y0 ] = = 1 ) { if( MaxNumSubblockMergeCand > 1 ) merge_subblock_idx[ x0][ y0 ] ae(v) } else { if( sps_ciip_enabled_flag && cu_skip_flag[ x0 ][y0 ] = = 0 && ( cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight< 128 ) { ciip_flag[ x0 ][ y0 ] ae(v) if( ciip_flag[ x0 ][ y0 ] &&MaxNumMergeCand > 1 ) merge_idx[ x0 ][ y0 ] ae(v) } if(MergeTriangleFlag[ x0 ][ y0 ] ) { merge_triangle_split_dir[ x0 ][ y0 ]ae(v) merge_triangle_idx0[ x0 ][ y0 ] ae(v) merge_triangle_idx1[ x0 ][y0 ] ae(v) } } } } } }

mmvd_merge_flag[x0][y0] equal to 1 specifies that merge mode with motionvector difference is used to generate the inter prediction parameters ofthe current coding unit. The array indices x0, y0 specify the location(x0, y0) of the top-left luma sample of the considered coding blockrelative to the top-left luma sample of the picture.

When mmvd_merge_flag[x0][y0] is not present, it is inferred as follows.

If all of the following conditions are true, mmvd_merge_flag[x0][y0] isinferred to be equal to 1.

-   -   general_merge_flag[x0][y0] is equal to 1    -   regular_merge_flag[x0][y0] is equal to 0    -   sps_mmvd_enable_flag is equal to 1    -   cbWidth*cbHeight !=32    -   MaxNumSubblockMergeCand<=0 or cbWidth<8 or cbHeight<8    -   sps_ciip_enabled_flag is equal to 0 or cbWidth>=128 or        cbHeight>=128 or cu_skip_flag[x0][y0] is equal to 1    -   sps_triangle_enabled_flag is equal to 0 or        MaxNumTriangleMergeCand<2 or slice_type is not equal to B_SLICE

Otherwise, mmvd_merge_flag[x0][y0] is inferred to be equal to 0.

Meanwhile, according to another embodiment, as an example, the encodingapparatus may include a merge subblock flag in the image informationbased on that a condition based on the CIIP enabled flag and a conditionbased on a size of the current block is satisfied so that the samesyntax is not repeatedly transmitted. Here, the condition based on thesize of the current block may be a case in which a product of a heightof the current block and a width of the current block is 64 or greaterand the height of the current block and the width of the current blockare each smaller than 128. The condition based on the CIIP enabled flagmay be a case in which a value of the CIIP enabled flag is 1. In otherwords, when the product of the height of the current block and the widthof the current block is 64 or greater, the height of the current blockand the width of the current block are each smaller than 128, and thevalue of the CIIP enabled flag is 1, the encoding apparatus may thensignal the merge subblock flag.

As another example, the encoding apparatus may include the mergesubblock flag in the image information based on that the condition basedon the CU skip flag is further satisfied in addition to the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block. Here, the condition based on the CU skip flag may bea case in which the value of the CU skip flag is 0. In other words, whenthe product of the height of the current block and the width of thecurrent block is 64 or greater, the height of the current block and thewidth of the current block are less than 128, the value of the CIIPenabled flag is 1, and a value of the CU skip flag is 0, the encodingapparatus may then signal the merge subblock flag.

As another example, the encoding apparatus may include the mergesubblock flag in the image information based on that a condition basedon the information on the current block and the partitioning modeenabled flag is satisfied. Here, the condition based on the informationon the current block may include a case in which the product of thewidth and the height of the current block is 64 or greater and/or a casein which a slice type including the current block is a B slice. Thecondition based on the partitioning mode enabled flag may be a case inwhich the value of the partitioning mode enabled flag is 1. In otherwords, when both the condition based on the height of the current blockand information on the current block and the condition based on thepartitioning mode enabled flag are satisfied, the encoding apparatus maysignal the merge subblock flag.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the encodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag issatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag is notsatisfied, the encoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

Meanwhile, the encoding apparatus may signal the merge subblock flagwhen the maximum number of subblock merge candidates is greater than 0and the width and height of the current block are each 8 or greater.

To this end, as an example, the merge data syntax may be configured asshown in Table 8 below.

TABLE 8 Descriptor merge_data( x0, y0, cbWidth, cbHeight ) { if (CuPredMode[ x0 ][ y0 ] = = MODE_IBC ) { if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag | |cbWidth * cbHeight != 32 ) regular_merge_flag[ x0 ][ y0 ] ae(v) if (regular_merge_flag[ x0 ][ y0 ] = = 1 ){ if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag &&cbWidth * cbHeight != 32 ) mmvd_merge_flag[ x0 ][ y0 ] ae(v) if(mmvd_merge_flag[ x0 ][ y0 ] = = 1 ) { if( MaxNumMergeCand > 1 )mmvd_cand_flag[ x0 ][ y0 ] ae(v) mmvd_distance_idx[ x0 ][ y0 ] ae(v)mmvd_direction_idx[ x0 ][ y0 ] ae(v) } else { if((MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 ) ||(sps_ciip_enabled_flag && cu_skip_flag[ x0 ][ y0 ] = = 0 &&  cbWidth *CbHeight >= 64 && cbWidth < 128 && cbHeight < 128) ||(sps_triangle_enabled_flag && cbWidth * cbHeight>=64 && MaxNumTriangleMergeCand>=2 && slice_type = = B SLICE))merge_subblock_flag[ x0 ][ y0 ] ae(v) if( merge_subblock_flag[ x0 ][ y0] = = 1 ) { if( MaxNumSubblockMergeCand > 1 ) merge_subblock_idx[ x0 ][y0 ] ae(v) } else { if( sps_ciip_enabled_flag && cu_skip_flag[ x0 ][ y0] = = 0 && ( cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight <128 ) { ciip_flag[ x0 ][ y0 ] ae(v) if( ciip_flag[ x0 ][ y0 ] &&MaxNumMergeCand > 1 ) merge_idx[ x0 ][ y0 ] ae(v) } if(MergeTriangleFlag[ x0 ][ y0 ] ) { merge_triangle_split_dir[ x0 ][ y0 ]ae(v) merge_triangle_idx0[ x0 ][ y0 ] ae(v) merge_triangle_idx1[ x0 ][y0 ] ae(v) } } } } } }

merge_subblock_flag[x0][y0] specifies whether the subblock-based interprediction parameters for the current coding unit are inferred fromneighbouring blocks. The array indices x0, y0 specify the location (x0,y0) of the top-left luma sample of the considered coding block relativeto the top-left luma sample of the picture.

When merge_subblock_flag[x0][y0] is not present, it is inferred asfollow.

If all of the following conditions are true, merge_subblock_flag[x0][y0]is inferred to be equal to 1.

-   -   general_merge_flag[x0][y0] is equal to 1    -   regular_merge_flag[x0][y0] is equal to 0    -   merge_subblock_flag[x0][y0] is equal to 0    -   mmvd_merge_flag[x0][y0] is equal to 0    -   MaxNumSubblockMergeCand>0    -   cbWidth>=8 and cbHeight>=8    -   sps_ciip_enabled_flag is equal to 0 or cbWidth>=128 or        cbHeight>=128 or cu_skip_flag[x0][y0] is equal to 1    -   sps_triangle_enabled_flag is equal to 0 or        MaxNumTriangleMergeCand<2 or slice_type is not equal to B_SLICE

Otherwise, merge_subblock_flag[x0][y0] is inferred to be equal to 0.

Meanwhile, according to another embodiment, as an example, the encodingapparatus may include the CIIP flag in the image information based onthat the condition based on the CIIP enabled flag and the conditionbased on the size of the current block is satisfied so that the samesyntax is not repeatedly transmitted. Here, the condition based on thesize of the current block may be a case in which the product of theheight of the current block and the width of the current block is 64 orgreater and the height of the current block and the width of the currentblock are each smaller than 128. The condition based on the CIIP enabledflag may be a case in which the value of the CIIP enabled flag is 1. Inother words, when the product of the height of the current block and thewidth of the current block is 64 or greater, the height of the currentblock and the width of the current block are smaller than 128, and thevalue of the CIIP enabled flag is 1, the encoding apparatus may signalthe CIIP flag.

As another example, the encoding apparatus may include the CIIP flag inthe image information based on that the condition based on the CU skipflag is further satisfied in addition to the condition based on the CIIPenabled flag and the condition based on the size of the current block.Here, the condition based on the CU skip flag may be a case in which thevalue of the CU skip flag is 0. In other words, when the product of theheight of the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are each smaller than 128, the value of the CIIP enabled flag is1, and the value of the CU skip flag is 0, the encoding apparatus maythen signal the CIIP flag.

As another example, the encoding apparatus may include the CIIP flag inthe image information based on that the condition based on theinformation on the current block and the partitioning mode enabled flagare satisfied. Here, the condition based on the information on thecurrent block may include the case in which the product of the width andthe height of the current block is 64 or greater and/or a case in whicha slice type including the current block is a B slice. The conditionbased on the partitioning mode enabled flag may be a case in which thevalue of the partitioning mode enabled flag is 1. In other words, theencoding apparatus may signal the CIIP flag when both the conditionbased on the height of the current block and information on the currentblock and the condition based on the partitioning mode enabled flag aresatisfied.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the encodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag aresatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag are notsatisfied, the encoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

To this end, as an example, the merge data syntax may be configured asshown in Table 9 below.

TABLE 9 Descriptor merge_data( x0, y0, cbWidth, cbHeight ) { if (CuPrecMode[ x0 ][ y0 ] = = MODE_IBC ) { if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag | |cbWidth * cbHeight != 32 ) regular_merge_flag[ x0 ][ y0 ] ae(v) if (regular_merge_flag[ x0 ][ y0 ] = = 1 ){ if( MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ] ae(v) } else { if( sps_mmvd_enabled_flag &&cbWidth * cbHeight != 32 ) mmvd_merge_flag[ x0 ][ y0 ] ae(v) if(mmvd_merge_flag[ x0 ][ y0 ] = = 1 ) { if( MaxNumMergeCand > 1 )mmvd_cand_flag[ x0 ][ y0 ] ae(v) mmvd_distance_idx[ x0 ][ y0 ] ae(v)mmvd_direction_idx[ x0 ][ y0 ] ae(v) } else { if(MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 )merge_subblock_flag[ x0 ][ y0 ] ae(v) if( merge_subblock_flag[ x0 ][ y0] = = 1 ) { if( MaxNumSubblockMergeCand > 1 ) merge_subblock_idx[ x0 ][y0 ] ae(v) } else { if(( sps_ciip_enabled_flag && cu_stop_flag[ x0 ][ y0] = = 0 && ( cbWidth * cbHeight ) >= 64 && cbWidth < 128 && cbHeight <128 ) || (sps_triangle_enabled_flag && cbWidth * cbHeight>=64 &&MaxNumTriangleMergeCand>=2 && slice_type = = B_SLICE){ ciip_flag[ x0 ][y0 ] ae(v) if( ciip_flag[ x0 ][ y0 ] && MaxNumMergeCand > 1 ) merge_idx[x0 ][ y0 ] ae(v) } if( MergeTriangleFlag[ x0 ][ y0 ] ) {merge_triangle_split_dir[ x0 ][ y0 ] ae(v) merge_triangle_idx0[ x0 ][ y0] ae(v) merge_triangle_idx1[ x0 ][ y0 ] ae(v) } } } } } }

ciip_flag[x0][y0] specifies whether the combined inter-picture merge andintra-picture prediction is applied for the current coding unit.Ciip_flag[x0][y0] specifies whether the combined inter-picture merge andintra-picture prediction is applied for the current coding unit.

When ciip_flag[x0][y0] is not present, it is inferred as follows.

If all of the following conditions are true, ciip_flag[x0][y0] isinferred to be equal to 1.

-   -   general_merge_flag[x0][y0] is equal to 1    -   regular_merge_flag[x0][y0] is equal to 0    -   merge_subblock_flag[x0][y0] is equal to 0    -   mmvd_merge_flag[x0][y0] is equal to 0    -   sps_ciip_enabled_flag is equal to 1    -   cu_skip_flag[x0][y0] is equal to 0

cbWidth*cbHeight>=64 and cbWidth<128 and cbHeight<128

-   -   sps_triangle_enabled_flag is equal to 0 or        MaxNumTriangleMergeCand<2 or slice_type is not equal to B_SLICE

Otherwise, ciip_flag[x0][y0] is inferred to be equal to 0.

FIGS. 12 and 13 schematically show an example of a video/image decodingmethod including an inter prediction method and related componentsaccording to an embodiment of the present document.

The decoding method disclosed in FIG. 12 may be performed by thedecoding apparatus 300 disclosed in FIGS. 3 and 13. Specifically, forexample, steps S1200 and S1210 of FIG. 12 may be performed by theentropy decoder 310 of the decoding apparatus, step S1220 may beperformed by the predictor 330 of the decoding apparatus 300, and stepS1230 may be performed by the adder 340 of the decoding apparatus 300.The decoding method disclosed in FIG. 12 may include the embodimentsdescribed above in this document.

Referring to FIGS. 12 and 13, the decoding apparatus may obtain at leastone of a CIIP enabled flag and a CU skip flag from a bitstream (S1200).Specifically, the entropy decoder 310 of the decoding apparatus mayderive residual information and information on the prediction mode froma signal received in the form of a bitstream from the encoding apparatusof FIG. 2. Here, the information on the prediction mode may be referredto as prediction related information. The information on the predictionmode may include inter/intra prediction classification information,inter prediction mode information, and the like, and may include varioussyntax elements related thereto.

The bitstream may include image information including information onvarious parameter sets, such as an adaptation parameter set (APS), apicture parameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). The image information may further includeinformation on the prediction mode of the current block, such as acoding unit syntax and merge data syntax. The sequence parameter set mayinclude a CIIP enabled flag, an enabled flag for a partitioning mode,and the like. The coding unit syntax may include a CU skip flagindicating whether the skip mode is applied to the current block.

The predictor 330 of the decoding apparatus may acquire a regular mergeflag from the bitstream based on that at least one of a condition basedon the CIIP enabled flag and a condition based on the CU skip flag and acondition based on a size of the current block are satisfied (S1210).Also, the predictor 330 of the decoding apparatus may perform interprediction based on the regular merge flag to generate predictionsamples of the current block (S1220). For example, when the regularmerge flag is parsed from the bitstream, the predictor 330 of thedecoding apparatus may perform inter prediction in the (regular) mergemode described above. In this case, the predictor 330 of the decodingapparatus may construct a merge candidate list through the procedure ofFIG. 8 and select an optimal merge candidate using a merge indexacquired from the bitstream. In addition, the predictor 330 of thedecoding apparatus may generate prediction samples of the current blockusing motion information of the optimal merge candidate as motioninformation of the current block.

Meanwhile, the residual processor 320 of the decoding apparatus maygenerate residual samples based on the residual information. The adder340 of the decoding apparatus may generate reconstructed samples basedon the prediction samples generated by the predictor 330 and theresidual samples generated by the residual processor 320 (S1230). Areconstructed picture may be generated based on the reconstructedsamples. Thereafter, an in-loop filtering procedure such as deblockingfiltering, SAO and/or ALF procedures may be applied to the reconstructedpicture in order to improve subjective/objective image quality asneeded.

As an embodiment, in deriving the prediction mode of the current block,the decoding apparatus may acquire a regular merge flag from thebitstream based on that a condition based on the CIIP enabled flag and acondition based on the size of the current block are satisfied. Here,the condition based on the size of the current block may be a case inwhich a product of a height of the current block and a width of thecurrent block is 64 or greater and the height of the current block andthe width of the current block are each smaller than 128. The conditionbased on the CIIP enabled flag may be a case in which a value of theCIIP enabled flag is 1. In other words, when the product of the heightof the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are each smaller than 128, and the value of the CIIP enabled flagis 1, the decoding apparatus may then parse the regular merge flag fromthe merge data syntax included in the bitstream.

As another example, the regular merge flag may be acquired from thebitstream based on that a condition based on the CU skip flag and thesize of the current block are satisfied. Here, the condition based onthe size of the current block may be a case in which the product of theheight of the current block and the width of the current block is 64 orgreater and the height of the current block and the width of the currentblock are each smaller than 128. The condition based on the CU skip flagmay be a case in which the value of the CU skip flag is 0. In otherwords, when the product of the height of the current block and the widthof the current block is 64 or greater, the height of the current blockand the width of the current block are each smaller than 128, and thevalue of the CU skip flag is 0, the decoding apparatus may then parsethe regular merge flag from the merge data syntax included in thebitstream.

As another example, the decoding apparatus may acquire the regular mergeflag from the bitstream based on that at least one of the conditionbased on the CIIP enabled flag and the condition based on the CU skipflag and the condition based on the size of the current block aresatisfied. Here, the condition based on the CIIP enabled flag may be acase in which the value of the CIIP enabled flag is 1. The conditionbased on the CU skip flag may be a case in which the value of the CUskip flag is 0. In other words, when the product of the height of thecurrent block and the width of the current block is 64 or greater, theheight of the current block and the width of the current block are lessthan 128, the value of the CIIP enabled flag is 1, or a value of the CUskip flag is 0, the decoding apparatus may then parse the regular mergeflag from the merge data syntax.

As another example, the decoding apparatus may acquire the regular mergeflag from the bitstream based on that the condition based on the CU skipflag is further satisfied in addition to the condition based on the CIIPenabled flag and the condition based on the size of the current block.Here, the condition based on the CU skip flag may be a case in which thevalue of the CU skip flag is 0. In other words, when the product of theheight of the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are less than 128, the value of the CIIP enabled flag is 1, and avalue of the CU skip flag is 0, the decoding apparatus may then parsethe regular merge flag from the merge data syntax.

As another example, the decoding apparatus may acquire a regular mergeflag from the bitstream based on that a condition based on theinformation on the current block and the partitioning mode enabled flagis satisfied. Here, the condition based on the information on thecurrent block may include a case in which the product of the width andthe height of the current block is 64 or greater and/or a case in whicha slice type including the current block is a B slice. The conditionbased on the partitioning mode enabled flag may be a case in which thevalue of the partitioning mode enabled flag is 1. In other words, whenboth the condition based on the height of the current block andinformation on the current block and the condition based on thepartitioning mode enabled flag are satisfied, the decoding apparatus mayparse the regular merge flag from the merge data syntax.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the decodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag issatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag is notsatisfied, the decoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

Meanwhile, when the product of the width and height of the current blockis not 32 and the value of the MMVD enabled flag is 1 or when themaximum number of subblock merge candidates is greater than 0 and thewidth and height of the current block are 8 or greater, the decodingapparatus may parse the regular merge flag from the bitstream. To thisend, the merge data syntax may be configured as shown in Table 6 above.

When the regular merge flag does not exist in the bitstream, thedecoding apparatus may derive a value of the regular merge flag as 1, ifa value of a general merge flag is 1, a value of the MMVD enabled flagof the SPS is 0, the product of the width and the height of the currentblock is 32, the maximum number of the subblock merge candidates is 0 orless, the width of the current block is less than 8, the height of thecurrent block is less than 8, the value of the CIIP enable flag of theSPS is 0, the product of the width and height of the current block isless than 64, the width of the current block is 128 or greater, thevalue of the CU skip flag is 1, the value of the partitioning enabledflag of the SPS is 0, the maximum number of partitioning mergecandidates is less than 2, or a slice type is not B slice. Otherwise,the value of the regular merge flag may be derived as 0.

As another embodiment, in deriving the prediction mode of the currentblock, the decoding apparatus may acquire the MMVD merge flag from thebitstream based on that the condition based on the CIIP enabled flag andthe condition based on the size of the current block are satisfied.Here, the condition based on the size of the current block may be a casein which a product of a height of the current block and a width of thecurrent block is 64 or greater and the height of the current block andthe width of the current block are each smaller than 128. The conditionbased on the CIIP enabled flag may be a case in which a value of theCIIP enabled flag is 1. In other words, when the product of the heightof the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are each smaller than 128, and the value of the CIIP enabled flagis 1, the decoding apparatus may then parse the MMVD merge flag from themerge data syntax included in the bitstream.

As another example, the decoding apparatus may acquire the MMVD mergeflag from the bitstream based on that the condition based on the CU skipflag and the size of the current block is satisfied. Here, the conditionbased on the size of the current block may be a case in which theproduct of the height of the current block and the width of the currentblock is 64 or greater and the height of the current block and the widthof the current block are each smaller than 128. The condition based onthe CU skip flag may be a case in which the value of the CU skip flag is0. In other words, when the product of the height of the current blockand the width of the current block is 64 or greater, the height of thecurrent block and the width of the current block are each smaller than128, and the value of the CU skip flag is 0, the decoding apparatus maythen parse the MMVD merge flag from the merge data syntax included inthe bitstream.

As another example, the decoding apparatus may acquire the MMVD mergeflag from the bitstream based on that the condition based on the CU skipflag is further satisfied in addition to the condition based on the CIIPenabled flag and the condition based on the size of the current block.Here, the condition based on the CU skip flag may be a case in which thevalue of the CU skip flag is 0. In other words, when the product of theheight of the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are less than 128, the value of the CIIP enabled flag is 1, and avalue of the CU skip flag is 0, the decoding apparatus may then parsethe MMVD merge flag from the merge data syntax.

As another example, the decoding apparatus may acquire the MMVD mergeflag from the bitstream based on that a condition based on theinformation on the current block and the partitioning mode enabled flagis satisfied. Here, the condition based on the information on thecurrent block may include a case in which the product of the width andthe height of the current block is 64 or greater and/or a case in whicha slice type including the current block is a B slice. The conditionbased on the partitioning mode enabled flag may be a case in which thevalue of the partitioning mode enabled flag is 1. In other words, whenboth the condition based on the height of the current block andinformation on the current block and the condition based on thepartitioning mode enabled flag are satisfied, the decoding apparatus mayparse the MMVD merge flag from the merge data syntax.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the decodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag issatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag is notsatisfied, the decoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

Meanwhile, when the product of the width and height of the current blockis not 32 and the value of the MMVD enabled flag is 1 or when themaximum number of subblock merge candidates is greater than 0 and thewidth and height of the current block are 8 or greater, the decodingapparatus may parse the MMVD merge flag from the bitstream. To this end,the merge data syntax may be configured as shown in Table 7 above.

When the MMVD merge flag does not exist in the bitstream, the decodingapparatus may derive a value of the MMVD merge flag as 1, if a value ofTHE general merge flag is 1, a value of the general merge flag is 0, avalue of the MMVD enabled flag of the SPS is 1, the product of the widthand the height of the current block is not 32, the maximum number of thesubblock merge candidates is 0 or less, the width of the current blockis less than 8, the height of the current block is less than 8, thevalue of the CIIP enable flag of the SPS is 0, the width of the currentblock is 128 or greater, the height of the current block is 128 orgreater, the value of the CU skip flag is 1, the value of thepartitioning enabled flag of the SPS is 0, the maximum number ofpartitioning merge candidates is less than 2, or a slice type is not Bslice. Otherwise, the value of the MMVD merge flag may be derived as 0.

As another embodiment, in deriving the prediction mode of the currentblock, the decoding apparatus may acquire a merge subblock flag from thebitstream based on that a condition based on the CIIP enabled flag and acondition based on the size of the current block are satisfied. Here,the condition based on the size of the current block may be a case inwhich a product of a height of the current block and a width of thecurrent block is 64 or greater and the height of the current block andthe width of the current block are each smaller than 128. The conditionbased on the CIIP enabled flag may be a case in which a value of theCIIP enabled flag is 1. In other words, when the product of the heightof the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are each smaller than 128, and the value of the CIIP enabled flagis 1, the decoding apparatus may then parse the merge subblock flag fromthe merge data syntax included in the bitstream.

As another example, the merge subblock flag may be acquired from thebitstream based on that a condition based on the CU skip flag and thesize of the current block are satisfied. Here, the condition based onthe size of the current block may be a case in which the product of theheight of the current block and the width of the current block is 64 orgreater and the height of the current block and the width of the currentblock are each smaller than 128. The condition based on the CU skip flagmay be a case in which the value of the CU skip flag is 0. In otherwords, when the product of the height of the current block and the widthof the current block is 64 or greater, the height of the current blockand the width of the current block are each smaller than 128, and thevalue of the CU skip flag is 0, the decoding apparatus may then parsethe merge subblock flag from the merge data syntax included in thebitstream.

As another example, the decoding apparatus may acquire the mergesubblock flag from the bitstream based on that the condition based onthe CU skip flag is further satisfied in addition to the condition basedon the CIIP enabled flag and the condition based on the size of thecurrent block. Here, the condition based on the CU skip flag may be acase in which the value of the CU skip flag is 0. In other words, whenthe product of the height of the current block and the width of thecurrent block is 64 or greater, the height of the current block and thewidth of the current block are less than 128, the value of the CIIPenabled flag is 1, and a value of the CU skip flag is 0, the decodingapparatus may then parse the merge subblock flag from the merge datasyntax.

As another example, the decoding apparatus may acquire a merge subblockflag from the bitstream based on that a condition based on theinformation on the current block and the partitioning mode enabled flagis satisfied. Here, the condition based on the information on thecurrent block may include a case in which the product of the width andthe height of the current block is 64 or greater and/or a case in whicha slice type including the current block is a B slice. The conditionbased on the partitioning mode enabled flag may be a case in which thevalue of the partitioning mode enabled flag is 1. In other words, whenboth the condition based on the height of the current block andinformation on the current block and the condition based on thepartitioning mode enabled flag are satisfied, the decoding apparatus mayparse the merge subblock flag from the merge data syntax.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the decodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag issatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag is notsatisfied, the decoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied.

Meanwhile, when the maximum number of subblock merge candidates isgreater than 0 and the width and height of the current block are 8 orgreater, the decoding apparatus may parse the merge subblock flag fromthe bitstream. To this end, the merge data syntax may be configured asshown in Table 8 above.

When the merge subblock flag does not exist in the bitstream, thedecoding apparatus may drive a value of the merge subblock flag as 1, ifa value of a general merge flag is 1, a value of the regular merge flagis 0, a value of the merge subblock flag is 0, a value of the MMVD mergeflag is 0, the maximum number of the subblock merge candidates isgreater than 0, the width and height of the current block is 8 orgreater, a value of the CIIP enable flag of the SPS is 0, the width ofthe current block is 128 or greater, the height of the current block is128 or greater, the value of the CU skip flag is 1, the value of thepartitioning enabled flag of the SPS is 0, the maximum number ofpartitioning merge candidates is less than 2, or a slice type is not Bslice. Otherwise, the value of the merge subblock flag may be derived as1.

As another embodiment, in deriving the prediction mode of the currentblock, the decoding apparatus may acquire the MMVD merge flag from thebitstream based on that the condition based on the CIIP enabled flag andthe condition based on the size of the current block are satisfied.Here, the condition based on the size of the current block may be a casein which a product of a height of the current block and a width of thecurrent block is 64 or greater and the height of the current block andthe width of the current block are each smaller than 128. The conditionbased on the CIIP enabled flag may be a case in which a value of theCIIP enabled flag is 1. In other words, when the product of the heightof the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are each smaller than 128, and the value of the CIIP enabled flagis 1, the decoding apparatus may then parse the CIIP flag from the mergedata syntax.

As another example, the decoding apparatus may acquire the CIIP flagfrom the bitstream based on that the condition based on the CU skip flagis further satisfied in addition to the condition based on the CIIPenabled flag and the condition based on the size of the current block.Here, the condition based on the CU skip flag may be a case in which thevalue of the CU skip flag is 0. In other words, when the product of theheight of the current block and the width of the current block is 64 orgreater, the height of the current block and the width of the currentblock are less than 128, the value of the CIIP enabled flag is 1, and avalue of the CU skip flag is 0, the decoding apparatus may then parsethe CIIP flag from the merge data syntax.

As another example, the decoding apparatus may acquire the CIIP flagfrom the bitstream based on that a condition based on the information onthe current block and the partitioning mode enabled flag is satisfied.Here, the condition based on the information on the current block mayinclude a case in which the product of the width and the height of thecurrent block is 64 or greater and/or a case in which a slice typeincluding the current block is a B slice. The condition based on thepartitioning mode enabled flag may be a case in which the value of thepartitioning mode enabled flag is 1. In other words, when both thecondition based on the height of the current block and information onthe current block and the condition based on the partitioning modeenabled flag are satisfied, the decoding apparatus may parse the CIIPflag from the merge data syntax.

When the condition based on the CIIP enabled flag and the conditionbased on the size of the current block are not satisfied, the decodingapparatus may determine whether the condition based on the informationon the current block and the partitioning mode enabled flag issatisfied. Alternatively, when the condition based on the information onthe current block and the partitioning mode enabled flag is notsatisfied, the decoding apparatus may determine whether the conditionbased on the CIIP enabled flag and the condition based on the size ofthe current block are satisfied. To this end, the merge data syntax maybe configured as shown in Table 9 above.

When the CIIP flag is not present in the bitstream, the decodingapparatus may derive the value of the CIIP flag as 1, if the value ofthe general merge flag is 1, the value of the regular merge flag is 0,the value of the merge subblock flag is 0, the value of the MMVD mergeflag is 0, the value of the CIIP enable flag of the SPS is 1, the valueof the CU skip flag is 0, the product of the width and height of thecurrent block is 64 or greater, and the width and height of the currentblock are smaller than 128, the value of the partitioning enable flag ofthe SPS is 0, the maximum number of partitioning merge candidates isless than 2, or the slice type is not B slice. Otherwise, the value ofthe CIIP flag may be derived as 0.

Although methods have been described on the basis of a flowchart inwhich steps or blocks are listed in sequence in the above-describedembodiments, the steps of the present disclosure are not limited to acertain order, and a certain step may be performed in a different stepor in a different order or concurrently with respect to that describedabove. Further, it will be understood by those ordinary skilled in theart that the steps of the flowcharts are not exclusive, and another stepmay be included therein or one or more steps in the flowchart may bedeleted without exerting an influence on the scope of the presentdisclosure.

The aforementioned method according to the present disclosure may be inthe form of software, and the encoding apparatus and/or decodingapparatus according to the present disclosure may be included in adevice for performing image processing, for example, a TV, a computer, asmart phone, a set-top box, a display device, or the like.

When the embodiments of the present disclosure are implemented bysoftware, the aforementioned method may be implemented by a module(process or function) which performs the aforementioned function. Themodule may be stored in a memory and executed by a processor. The memorymay be installed inside or outside the processor and may be connected tothe processor via various well-known means. The processor may includeApplication-Specific Integrated Circuit (ASIC), other chipsets, alogical circuit, and/or a data processing device. The memory may includea Read-Only Memory (ROM), a Random Access Memory (RAM), a flash memory,a memory card, a storage medium, and/or other storage device. In otherwords, the embodiments according to the present disclosure may beimplemented and executed on a processor, a micro-processor, acontroller, or a chip. For example, functional units illustrated in therespective figures may be implemented and executed on a computer, aprocessor, a microprocessor, a controller, or a chip. In this case,information on implementation (for example, information on instructions)or algorithms may be stored in a digital storage medium.

In addition, the decoding apparatus and the encoding apparatus to whichthe embodiment(s) of the present disclosure is applied may be includedin a multimedia broadcasting transceiver, a mobile communicationterminal, a home cinema video device, a digital cinema video device, asurveillance camera, a video chat device, and a real time communicationdevice such as video communication, a mobile streaming device, a storagemedium, a camcorder, a video on demand (VoD) service provider, an OverThe Top (OTT) video device, an internet streaming service provider, a 3Dvideo device, a Virtual Reality (VR) device, an Augment Reality (AR)device, an image telephone video device, a vehicle terminal (forexample, a vehicle (including an autonomous vehicle) terminal, anairplane terminal, or a ship terminal), and a medical video device; andmay be used to process an image signal or data. For example, the OTTvideo device may include a game console, a Bluray player, anInternet-connected TV, a home theater system, a smartphone, a tablet PC,and a Digital Video Recorder (DVR).

In addition, the processing method to which the embodiment(s) of thepresent disclosure is applied may be produced in the form of a programexecuted by a computer and may be stored in a computer-readablerecording medium. Multimedia data having a data structure according tothe embodiment(s) of the present disclosure may also be stored in thecomputer-readable recording medium. The computer readable recordingmedium includes all kinds of storage devices and distributed storagedevices in which computer readable data is stored. The computer-readablerecording medium may include, for example, a Bluray disc (BD), auniversal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, aCD-ROM, a magnetic tape, a floppy disk, and an optical data storagedevice. The computer-readable recording medium also includes mediaembodied in the form of a carrier wave (for example, transmission overthe Internet). In addition, a bitstream generated by the encoding methodmay be stored in the computer-readable recording medium or transmittedthrough a wired or wireless communication network.

In addition, the embodiment(s) of the present disclosure may be embodiedas a computer program product based on a program code, and the programcode may be executed on a computer according to the embodiment(s) of thepresent disclosure. The program code may be stored on acomputer-readable carrier.

FIG. 14 represents an example of a contents streaming system to whichthe embodiment of the present document may be applied.

Referring to FIG. 14, the content streaming system to which theembodiments of the present document is applied may generally include anencoding server, a streaming server, a web server, a media storage, auser device, and a multimedia input device.

The encoding server functions to compress to digital data the contentsinput from the multimedia input devices, such as the smart phone, thecamera, the camcorder and the like, to generate a bitstream, and totransmit it to the streaming server. As another example, in a case wherethe multimedia input device, such as, the smart phone, the camera, thecamcorder or the like, directly generates a bitstream, the encodingserver may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgeneration method to which the embodiments of the present document isapplied. And the streaming server may temporarily store the bitstream ina process of transmitting or receiving the bitstream.

The streaming server transmits multimedia data to the user equipment onthe basis of a user's request through the web server, which functions asan instrument that informs a user of what service there is. When theuser requests a service which the user wants, the web server transfersthe request to the streaming server, and the streaming server transmitsmultimedia data to the user. In this regard, the contents streamingsystem may include a separate control server, and in this case, thecontrol server functions to control commands/responses betweenrespective equipment in the content streaming system.

The streaming server may receive contents from the media storage and/orthe encoding server. For example, in a case the contents are receivedfrom the encoding server, the contents may be received in real time. Inthis case, the streaming server may store the bitstream for apredetermined period of time to provide the streaming service smoothly.

For example, the user equipment may include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personaldigital assistant (PDA), a portable multimedia player (PMP), anavigation, a slate PC, a tablet PC, an ultrabook, a wearable device(e.g., a watch-type terminal (smart watch), a glass-type terminal (smartglass), a head mounted display (HMD)), a digital TV, a desktop computer,a digital signage or the like.

Each of servers in the contents streaming system may be operated as adistributed server, and in this case, data received by each server maybe processed in distributed manner.

1. A decoding method performed by a decoding apparatus, the decodingmethod comprising: acquiring, from a bitstream, at least one of acombined inter-picture merge and intra-picture prediction (CIIP) enabledflag and a coding unit (CU) skip flag indicating whether a skip mode isapplied to a current block; acquiring a regular merge flag from thebitstream based on that at least one of a condition based on the CIIPenabled flag and a condition based on the CU skip flag and a conditionbased on a size of the current block are satisfied; performing interprediction based on the regular merge flag to generate predictionsamples of the current block; and generating reconstructed samples basedon the prediction samples.
 2. The decoding method of claim 1, whereinthe condition based on the size of the current block is that a productof a height of the current block and a width of the current block is 64or greater.
 3. The decoding method of claim 1, wherein the conditionbased on the size of the current block is that a height of the currentblock and a width of the current each are smaller than
 128. 4. Thedecoding method of claim 1, wherein the condition based on the CIIPenabled flag is that a value of the CIIP enabled flag is
 1. 5. Thedecoding method of claim 1, wherein the condition based on the CU skipflag is that a value of the CU skip flag is
 0. 6. The decoding method ofclaim 1, further comprising: acquiring, from the bitstream, an enabledflag for a partitioning mode in which prediction is performed bydividing the current block into two partitions, wherein the acquiring ofthe regular merge flag includes: parsing the regular merge flag from thebitstream based on that at least one of the condition based on the CIIPenabled flag and the condition based on the CU skip flag and thecondition based on the size of the current block are not satisfied andthat the condition based on the information on the current block and thecondition based on the partitioning mode enabled flag are satisfied. 7.The decoding method of claim 6, wherein the condition based on thecurrent block is that a type of a slice including the current block is aB slice.
 8. The decoding method of claim 6, wherein the condition basedon the partitioning mode enabled flag is that a value of thepartitioning mode enabled flag is
 1. 9. An encoding method performed byan encoding apparatus, the encoding method comprising: derivingprediction samples of a current block based on inter prediction;generating information on a prediction mode indicating a prediction modeof the current block; deriving residual samples based on the predictionsamples; generating residual information based on the residual samples;and encoding image information including the information on theprediction mode and the residual information, wherein the imageinformation includes at least one of a combined inter-picture merge andintra-picture prediction (CIIP) enabled flag and a coding unit (CU) skipflag indicating whether a skip mode is applied to the current block, andthe image information includes a regular merge flag based on that atleast one of a condition based on the CIIP enabled flag and a conditionbased on the CU skip flag and a condition based on a size of the currentblock are satisfied.
 10. The encoding method of claim 9, wherein thecondition based on the size of the current block is that a product of aheight of the current block and a width of the current block is 64 orgreater, and a height of the current block and a width of the currenteach are smaller than
 128. 11. The encoding method of claim 9, whereinthe condition based on the CIIP enabled flag is that a value of the CIIPenabled flag is
 1. 12. The encoding method of claim 9, wherein thecondition based on the CU skip flag is that a value of the CU skip flagis
 0. 13. (canceled)
 14. (canceled)
 15. (canceled)
 16. A non-transitorycomputer-readable digital storage medium storing a bitstream generatedby an image encoding method, the method comprising: deriving predictionsamples of a current block based on inter prediction; generatinginformation on a prediction mode indicating a prediction mode of thecurrent block; deriving residual samples based on the predictionsamples; generating residual information based on the residual samples;and encoding image information to generate the bitstream, wherein theimage information includes the information on the prediction mode andthe residual information, wherein the image information includes atleast one of a combined inter-picture merge and intra-picture prediction(CIIP) enabled flag and a coding unit (CU) skip flag indicating whethera skip mode is applied to the current block, and the image informationincludes a regular merge flag based on that at least one of a conditionbased on the CIIP enabled flag and a condition based on the CU skip flagand a condition based on a size of the current block are satisfied. 17.The non-transitory computer-readable digital storage medium of claim 16,wherein the condition based on the size of the current block is that aproduct of a height of the current block and a width of the currentblock is 64 or greater, and a height of the current block and a width ofthe current each are smaller than
 128. 18. The non-transitorycomputer-readable digital storage medium of claim 16, wherein thecondition based on the CIIP enabled flag is that a value of the CIIPenabled flag is 1.